diff --git a/extensions/json/server/src/jsoncontributions/fileAssociationContribution.ts b/extensions/json/server/src/jsoncontributions/fileAssociationContribution.ts index 2fe85c551e5cfd829b9666a42d0d1c28810fae9c..0b9b2b57537e32c852dfb69ee491b6b8c2575497 100644 --- a/extensions/json/server/src/jsoncontributions/fileAssociationContribution.ts +++ b/extensions/json/server/src/jsoncontributions/fileAssociationContribution.ts @@ -36,7 +36,10 @@ export class FileAssociationContribution implements JSONWorkerContribution { public collectPropertyCompletions(resource: string, location: JSONPath, currentWord: string, addValue: boolean, isLast: boolean, result: CompletionsCollector): Thenable { if (this.isSettingsFile(resource) && location.length === 1 && location[0] === 'files.associations') { - globProperties.forEach((e) => result.add(e)); + globProperties.forEach(e => { + e.filterText = e.insertText; + result.add(e); + }); } return null; @@ -48,7 +51,8 @@ export class FileAssociationContribution implements JSONWorkerContribution { result.add({ kind: CompletionItemKind.Value, label: l, - insertText: '"{{' + l + '}}"', + insertText: JSON.stringify('{{' + l + '}}'), + filterText: JSON.stringify(l) }); }); } diff --git a/extensions/json/server/src/jsoncontributions/globPatternContribution.ts b/extensions/json/server/src/jsoncontributions/globPatternContribution.ts index 65a958bb9193ea3276dd36117573d9540b13527a..d2a3b873eec12f8b8055746d15363bbc9c6a2f58 100644 --- a/extensions/json/server/src/jsoncontributions/globPatternContribution.ts +++ b/extensions/json/server/src/jsoncontributions/globPatternContribution.ts @@ -21,8 +21,8 @@ let globProperties: CompletionItem[] = [ ]; let globValues: CompletionItem[] = [ - { kind: CompletionItemKind.Value, label: localize('trueLabel', "True"), insertText: 'true', documentation: localize('trueDescription', "Enable the pattern.") }, - { kind: CompletionItemKind.Value, label: localize('falseLabel', "False"), insertText: 'false', documentation: localize('falseDescription', "Disable the pattern.") }, + { kind: CompletionItemKind.Value, label: localize('trueLabel', "true"), insertText: 'true', documentation: localize('trueDescription', "Enable the pattern.") }, + { kind: CompletionItemKind.Value, label: localize('falseLabel', "false"), insertText: 'false', documentation: localize('falseDescription', "Disable the pattern.") }, { kind: CompletionItemKind.Value, label: localize('derivedLabel', "Files with Siblings by Name"), insertText: '{ "when": "$(basename).{{extension}}" }', documentation: localize('siblingsDescription', "Match files that have siblings with the same name but a different extension.") } ]; @@ -41,7 +41,10 @@ export class GlobPatternContribution implements JSONWorkerContribution { public collectPropertyCompletions(resource: string, location: JSONPath, currentWord: string, addValue: boolean, isLast: boolean, result: CompletionsCollector): Thenable { if (this.isSettingsFile(resource) && location.length === 1 && ((location[0] === 'files.exclude') || (location[0] === 'search.exclude'))) { - globProperties.forEach((e) => result.add(e)); + globProperties.forEach(e => { + e.filterText = e.insertText; + result.add(e); + }); } return null; @@ -49,7 +52,10 @@ export class GlobPatternContribution implements JSONWorkerContribution { public collectValueCompletions(resource: string, location: JSONPath, currentKey: string, result: CompletionsCollector): Thenable { if (this.isSettingsFile(resource) && location.length === 1 && ((location[0] === 'files.exclude') || (location[0] === 'search.exclude'))) { - globValues.forEach((e) => result.add(e)); + globValues.forEach(e => { + e.filterText = e.insertText; + result.add(e); + }); } return null;