mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Don't immediately return in getMemberSymbols.
This commit is contained in:
parent
9b6a027167
commit
218bbcd669
@ -1117,11 +1117,17 @@ namespace ts.Completions {
|
||||
let type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType();
|
||||
let insertQuestionDot = false;
|
||||
if (type.isNullableType()) {
|
||||
insertQuestionDot = isRightOfDot && !isRightOfQuestionDot;
|
||||
type = type.getNonNullableType();
|
||||
}
|
||||
if (insertQuestionDot && preferences.includeAutomaticOptionalChainCompletions === false) {
|
||||
return;
|
||||
const canCorrectToQuestionDot =
|
||||
isRightOfDot &&
|
||||
!isRightOfQuestionDot &&
|
||||
preferences.includeAutomaticOptionalChainCompletions !== false;
|
||||
|
||||
if (canCorrectToQuestionDot || isRightOfQuestionDot) {
|
||||
type = type.getNonNullableType();
|
||||
if (canCorrectToQuestionDot) {
|
||||
insertQuestionDot = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
addTypeProperties(type, !!(node.flags & NodeFlags.AwaitContext), insertQuestionDot);
|
||||
}
|
||||
@ -1141,11 +1147,17 @@ namespace ts.Completions {
|
||||
let type = typeChecker.getTypeAtLocation(node).getNonOptionalType();
|
||||
let insertQuestionDot = false;
|
||||
if (type.isNullableType()) {
|
||||
insertQuestionDot = isRightOfDot && !isRightOfQuestionDot;
|
||||
type = type.getNonNullableType();
|
||||
}
|
||||
if (insertQuestionDot && preferences.includeAutomaticOptionalChainCompletions === false) {
|
||||
return;
|
||||
const canCorrectToQuestionDot =
|
||||
isRightOfDot &&
|
||||
!isRightOfQuestionDot &&
|
||||
preferences.includeAutomaticOptionalChainCompletions !== false;
|
||||
|
||||
if (canCorrectToQuestionDot || isRightOfQuestionDot) {
|
||||
type = type.getNonNullableType();
|
||||
if (canCorrectToQuestionDot) {
|
||||
insertQuestionDot = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
addTypeProperties(type, !!(node.flags & NodeFlags.AwaitContext), insertQuestionDot);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user