mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
Fix #90931
This commit is contained in:
@@ -4,8 +4,9 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { getLocation, Location } from 'jsonc-parser';
|
||||
import { getLocation, Location, parse } from 'jsonc-parser';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { provideInstalledExtensionProposals } from './extensionsProposals';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
@@ -13,7 +14,7 @@ export class SettingsDocument {
|
||||
|
||||
constructor(private document: vscode.TextDocument) { }
|
||||
|
||||
public provideCompletionItems(position: vscode.Position, _token: vscode.CancellationToken): vscode.ProviderResult<vscode.CompletionItem[]> {
|
||||
public provideCompletionItems(position: vscode.Position, _token: vscode.CancellationToken): vscode.ProviderResult<vscode.CompletionItem[] | vscode.CompletionList> {
|
||||
const location = getLocation(this.document.getText(), this.document.offsetAt(position));
|
||||
const range = this.document.getWordRangeAtPosition(position) || new vscode.Range(position, position);
|
||||
|
||||
@@ -41,6 +42,15 @@ export class SettingsDocument {
|
||||
});
|
||||
}
|
||||
|
||||
// sync.ignoredExtensions
|
||||
if (location.path[0] === 'sync.ignoredExtensions') {
|
||||
let ignoredExtensions = [];
|
||||
try {
|
||||
ignoredExtensions = parse(this.document.getText())['sync.ignoredExtensions'];
|
||||
} catch (e) {/* ignore error */ }
|
||||
return provideInstalledExtensionProposals(ignoredExtensions, range, true);
|
||||
}
|
||||
|
||||
return this.provideLanguageOverridesCompletionItems(location, position);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user