mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Fix #39737
This commit is contained in:
parent
8608aaeb6a
commit
9772efe6bc
|
@ -151,9 +151,18 @@ export class SettingsDocument {
|
|||
|
||||
private provideLanguageCompletionItems(location: Location, range: vscode.Range, formatFunc: (string: string) => string = (l) => JSON.stringify(l)): vscode.ProviderResult<vscode.CompletionItem[]> {
|
||||
return vscode.languages.getLanguages().then(languages => {
|
||||
return languages.map(l => {
|
||||
return this.newSimpleCompletionItem(formatFunc(l), range);
|
||||
});
|
||||
const completionItems = [];
|
||||
const configuration = vscode.workspace.getConfiguration();
|
||||
for (const language of languages) {
|
||||
const inspect = configuration.inspect(`[${language}]`);
|
||||
if (!inspect || !inspect.defaultValue) {
|
||||
const item = new vscode.CompletionItem(formatFunc(language));
|
||||
item.kind = vscode.CompletionItemKind.Property;
|
||||
item.range = range;
|
||||
completionItems.push(item);
|
||||
}
|
||||
}
|
||||
return completionItems;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue