Skip to content

Commit d8c871e

Browse files
atscottalxhub
authored andcommitted
refactor(vscode-extension): Remove effectively dead code
Since bundled path is at the start of probe locations, it's always going to be found first. Workspace versions will never be used. getProbeLocations is effectively dead and confusing code.
1 parent 3403e79 commit d8c871e

1 file changed

Lines changed: 2 additions & 22 deletions

File tree

  • vscode-ng-language-service/client/src

‎vscode-ng-language-service/client/src/client.ts‎

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,7 @@ export class AngularLanguageClient implements vscode.Disposable {
439439
args.push('--logVerbosity', ngLog);
440440
}
441441

442-
const ngProbeLocations = getProbeLocations(this.context.extensionPath);
443-
args.push('--ngProbeLocations', ngProbeLocations.join(','));
442+
args.push('--ngProbeLocations', this.context.extensionPath);
444443

445444
const includeAutomaticOptionalChainCompletions = config.get<boolean>(
446445
'angular.suggest.includeAutomaticOptionalChainCompletions',
@@ -517,8 +516,7 @@ export class AngularLanguageClient implements vscode.Disposable {
517516
if (tsdk.trim().length > 0) {
518517
args.push('--tsdk', tsdk);
519518
}
520-
const tsProbeLocations = [...getProbeLocations(this.context.extensionPath)];
521-
args.push('--tsProbeLocations', tsProbeLocations.join(','));
519+
args.push('--tsProbeLocations', this.context.extensionPath);
522520

523521
const supportClientSide = config.get('angular.server.useClientSideFileWatcher');
524522

@@ -762,24 +760,6 @@ function registerNotificationHandlers(
762760
return vscode.Disposable.from(...disposables);
763761
}
764762

765-
/**
766-
* Return the paths for the module that corresponds to the specified `configValue`,
767-
* and use the specified `bundled` as fallback if none is provided.
768-
* @param configName
769-
* @param bundled
770-
*/
771-
function getProbeLocations(bundled: string): string[] {
772-
const locations = [];
773-
// Prioritize the bundled version
774-
locations.push(bundled);
775-
// Look in workspaces currently open
776-
const workspaceFolders = vscode.workspace.workspaceFolders || [];
777-
for (const folder of workspaceFolders) {
778-
locations.push(folder.uri.fsPath);
779-
}
780-
return locations;
781-
}
782-
783763
function extensionVersionCompatibleWithAllProjects(serverModuleLocation: string): boolean {
784764
const languageServiceVersion = resolve(
785765
'@angular/language-service',

0 commit comments

Comments
 (0)