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