mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
files.associations intellisense does not work within quotation marks. Fxes #10184
This commit is contained in:
@@ -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)
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user