@@ -1604,6 +1604,16 @@ namespace ts.server {
1604
1604
return ! ! this . program && this . program . isSourceOfProjectReferenceRedirect ( fileName ) ;
1605
1605
}
1606
1606
1607
+ /*@internal */
1608
+ protected getGlobalPluginSearchPaths ( ) {
1609
+ // Search any globally-specified probe paths, then our peer node_modules
1610
+ return [
1611
+ ...this . projectService . pluginProbeLocations ,
1612
+ // ../../.. to walk from X/node_modules/typescript/lib/tsserver.js to X/node_modules/
1613
+ combinePaths ( this . projectService . getExecutingFilePath ( ) , "../../.." ) ,
1614
+ ] ;
1615
+ }
1616
+
1607
1617
protected enableGlobalPlugins ( options : CompilerOptions , pluginConfigOverrides : Map < any > | undefined ) : void {
1608
1618
if ( ! this . projectService . globalPlugins . length ) return ;
1609
1619
const host = this . projectService . host ;
@@ -1614,11 +1624,7 @@ namespace ts.server {
1614
1624
}
1615
1625
1616
1626
// Search any globally-specified probe paths, then our peer node_modules
1617
- const searchPaths = [
1618
- ...this . projectService . pluginProbeLocations ,
1619
- // ../../.. to walk from X/node_modules/typescript/lib/tsserver.js to X/node_modules/
1620
- combinePaths ( this . projectService . getExecutingFilePath ( ) , "../../.." ) ,
1621
- ] ;
1627
+ const searchPaths = this . getGlobalPluginSearchPaths ( ) ;
1622
1628
1623
1629
// Enable global plugins with synthetic configuration entries
1624
1630
for ( const globalPluginName of this . projectService . globalPlugins ) {
@@ -2527,10 +2533,7 @@ namespace ts.server {
2527
2533
return ;
2528
2534
}
2529
2535
2530
- // Search our peer node_modules, then any globally-specified probe paths
2531
- // ../../.. to walk from X/node_modules/typescript/lib/tsserver.js to X/node_modules/
2532
- const searchPaths = [ combinePaths ( this . projectService . getExecutingFilePath ( ) , "../../.." ) , ...this . projectService . pluginProbeLocations ] ;
2533
-
2536
+ const searchPaths = this . getGlobalPluginSearchPaths ( ) ;
2534
2537
if ( this . projectService . allowLocalPluginLoads ) {
2535
2538
const local = getDirectoryPath ( this . canonicalConfigFilePath ) ;
2536
2539
this . projectService . logger . info ( `Local plugin loading enabled; adding ${ local } to search paths` ) ;
0 commit comments