files.associations intellisense does not work within quotation marks. Fxes #10184

This commit is contained in:
Martin Aeschlimann
2016-08-08 17:33:36 +02:00
parent 58de2a3239
commit 11d23f1562
2 changed files with 16 additions and 6 deletions

View File

@@ -36,7 +36,10 @@ export class FileAssociationContribution implements JSONWorkerContribution {
public collectPropertyCompletions(resource: string, location: JSONPath, currentWord: string, addValue: boolean, isLast: boolean, result: CompletionsCollector): Thenable<any> {
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)
});
});
}

View File

@@ -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<any> {
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<any> {
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;