Skip to content

tsserver should prioritize pluginProbeLocations over peer node_modules #34616

@kyliau

Description

TypeScript Version:
3.7.0-dev.20191018

Search Terms:
tsserver plugin pluginProbeLocations

Code

// Search our peer node_modules, then any globally-specified probe paths
// ../../.. to walk from X/node_modules/typescript/lib/tsserver.js to X/node_modules/
const searchPaths = [combinePaths(this.projectService.getExecutingFilePath(), "../../.."), ...this.projectService.pluginProbeLocations];

Expected behavior:
If pluginProbeLocations are provided, tsserver should always prioritize that, and use peer node_modules as fallback.

Actual behavior:
pluginProbeLocations has no effect if tsserver finds the module in peer node_modules.

From tsserver logs:
In this case, pluginProbeLocations=/Users/aioiyuuko/.vscode/extensions/angular.ng-template-0.900.0-next.2/server/node_modules/@angular/language-service
However, the path is not respected, and instead the plugin was loaded from peer node_module.

Info 9    [9:31:48.985] Enabling plugin @angular/language-service from candidate paths: /Users/aioiyuuko/workspaces/pxn/anduin/node_modules/typescript/lib/tsserverlibrary.js/../../..,/Users/aioiyuuko/.vscode/extensions/angular.ng-template-0.900.0-next.2/server/node_modules/@angular/language-service
Info 10   [9:31:48.985] Loading @angular/language-service from /Users/aioiyuuko/workspaces/pxn/anduin/node_modules/typescript/lib/tsserverlibrary.js/../../.. (resolved to /Users/aioiyuuko/workspaces/pxn/anduin/node_modules/node_modules)
Info 11   [9:31:49.111] Plugin validation succeded

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions