Skip to content

Commit

Permalink
Don't enable commit characters when isNewIdentifierLocation is true
Browse files Browse the repository at this point in the history
Fixes #54386
  • Loading branch information
mjbvz committed Jul 16, 2018
1 parent 37a59a2 commit cbcafcc
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -21,7 +21,7 @@ const localize = nls.loadMessageBundle();


interface CommitCharactersSettings {
readonly enable: boolean;
readonly enabled: boolean;
readonly enableDotCompletions: boolean;
readonly enableCallCompletions: boolean;
}
Expand Down Expand Up @@ -147,6 +147,10 @@ class MyCompletionItem extends vscode.CompletionItem {

@memoize
public get commitCharacters(): string[] | undefined {
if (!this.commitCharactersSettings.enabled) {
return undefined;
}

const commitCharacters: string[] = [];
switch (this.tsEntry.kind) {
case PConst.Kind.memberGetAccessor:
Expand Down Expand Up @@ -331,7 +335,7 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider
return msg
.filter(entry => !shouldExcludeCompletionEntry(entry, completionConfiguration))
.map(entry => new MyCompletionItem(position, document, line.text, entry, completionConfiguration.useCodeSnippetsOnMethodSuggest, {
enable: enableCommitCharacters,
enabled: enableCommitCharacters,
enableDotCompletions,
enableCallCompletions: !completionConfiguration.useCodeSnippetsOnMethodSuggest
}));
Expand Down

0 comments on commit cbcafcc

Please sign in to comment.