mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-17 01:49:41 -05:00
Added option 'includeAutomaticOptionalChainCompletions' to disable '?.' completions.
This commit is contained in:
@@ -338,7 +338,12 @@ namespace ts.Completions {
|
||||
): CompletionEntry | undefined {
|
||||
let insertText: string | undefined;
|
||||
let replacementSpan: TextSpan | undefined;
|
||||
|
||||
const insertQuestionDot = origin && originIsNullableMember(origin);
|
||||
if (insertQuestionDot && preferences.includeAutomaticOptionalChainCompletions === false) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess;
|
||||
if (origin && originIsThisType(origin)) {
|
||||
insertText = needsConvertPropertyAccess
|
||||
|
||||
Reference in New Issue
Block a user