提交 11d23f15 编写于 作者: M Martin Aeschlimann

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

上级 58de2a32
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册