Skip to content

Commit f689982

Browse files
Keen Yee LiauRyanCavanaugh
Keen Yee Liau
authored andcommitted
Prioritize loading plugin from probeLocations over peer node_modules
This commit reoroders the loading sequence of a tsserver plugin. It should first check `pluginProbeLocations` before checking peer node_modules. PR closes microsoft#34616
1 parent 6f04f52 commit f689982

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/server/project.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,9 +1359,12 @@ namespace ts.server {
13591359
return;
13601360
}
13611361

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

13661369
if (this.projectService.globalPlugins) {
13671370
// Enable global plugins with synthetic configuration entries

0 commit comments

Comments
 (0)