提交 6bfc7ee2 编写于 作者: M Martin Aeschlimann

strange intellisense suggestion in settings.json. Fixes #41732

上级 f43d4249
...@@ -60,8 +60,9 @@ export class SettingsDocument { ...@@ -60,8 +60,9 @@ export class SettingsDocument {
private provideFilesAssociationsCompletionItems(location: Location, range: vscode.Range): vscode.ProviderResult<vscode.CompletionItem[]> { private provideFilesAssociationsCompletionItems(location: Location, range: vscode.Range): vscode.ProviderResult<vscode.CompletionItem[]> {
const completions: vscode.CompletionItem[] = []; const completions: vscode.CompletionItem[] = [];
if (location.path.length === 2) {
// Key // Key
if (location.path.length === 1) { if (!location.isAtPropertyKey || location.path[1] === '') {
completions.push(this.newSnippetCompletionItem({ completions.push(this.newSnippetCompletionItem({
label: localize('assocLabelFile', "Files with Extension"), label: localize('assocLabelFile', "Files with Extension"),
documentation: localize('assocDescriptionFile', "Map all files matching the glob pattern in their filename to the language with the given identifier."), documentation: localize('assocDescriptionFile', "Map all files matching the glob pattern in their filename to the language with the given identifier."),
...@@ -75,12 +76,11 @@ export class SettingsDocument { ...@@ -75,12 +76,11 @@ export class SettingsDocument {
snippet: location.isAtPropertyKey ? '"/${1:path to file}/*.${2:extension}": "${3:language}"' : '{ "/${1:path to file}/*.${2:extension}": "${3:language}" }', snippet: location.isAtPropertyKey ? '"/${1:path to file}/*.${2:extension}": "${3:language}"' : '{ "/${1:path to file}/*.${2:extension}": "${3:language}" }',
range range
})); }));
} } else {
// Value // Value
else if (location.path.length === 2 && !location.isAtPropertyKey) {
return this.provideLanguageCompletionItems(location, range); return this.provideLanguageCompletionItems(location, range);
} }
}
return Promise.resolve(completions); return Promise.resolve(completions);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册