[typescript-language-features] Add option for excluding library symbols in "Go to Symbol in Workspace" (#192798)

* add option for excluding library symbols

* clarify in message that new option requires ts 5.3

* remove expect error
This commit is contained in:
Gabriela Araujo Britto
2023-09-13 11:19:52 -07:00
committed by GitHub
parent ca3b12f580
commit f563e33800
4 changed files with 14 additions and 0 deletions

View File

@@ -122,6 +122,7 @@ export interface TypeScriptServiceConfiguration {
readonly enableTsServerTracing: boolean;
readonly localNodePath: string | null;
readonly globalNodePath: string | null;
readonly workspaceSymbolsExcludeLibrarySymbols: boolean;
}
export function areServiceConfigurationsEqual(a: TypeScriptServiceConfiguration, b: TypeScriptServiceConfiguration): boolean {
@@ -158,6 +159,7 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu
enableTsServerTracing: this.readEnableTsServerTracing(configuration),
localNodePath: this.readLocalNodePath(configuration),
globalNodePath: this.readGlobalNodePath(configuration),
workspaceSymbolsExcludeLibrarySymbols: this.readWorkspaceSymbolsExcludeLibrarySymbols(configuration),
};
}
@@ -255,4 +257,8 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu
private readWebProjectWideIntellisenseSuppressSemanticErrors(configuration: vscode.WorkspaceConfiguration): boolean {
return configuration.get<boolean>('typescript.tsserver.web.projectWideIntellisense.suppressSemanticErrors', true);
}
private readWorkspaceSymbolsExcludeLibrarySymbols(configuration: vscode.WorkspaceConfiguration): boolean {
return configuration.get<boolean>('typescript.workspaceSymbols.excludeLibrarySymbols', true);
}
}

View File

@@ -558,6 +558,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
providePrefixAndSuffixTextForRename: true,
allowRenameOfImportPath: true,
includePackageJsonAutoImports: this._configuration.includePackageJsonAutoImports,
excludeLibrarySymbolsInNavTo: this._configuration.workspaceSymbolsExcludeLibrarySymbols,
},
watchOptions
};