@@ -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 ;
@@ -1613,14 +1623,8 @@ namespace ts.server {
1613
1623
return ;
1614
1624
}
1615
1625
1616
- // 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
- ] ;
1622
-
1623
1626
// Enable global plugins with synthetic configuration entries
1627
+ const searchPaths = this . getGlobalPluginSearchPaths ( ) ;
1624
1628
for ( const globalPluginName of this . projectService . globalPlugins ) {
1625
1629
// Skip empty names from odd commandline parses
1626
1630
if ( ! globalPluginName ) continue ;
@@ -2527,10 +2531,7 @@ namespace ts.server {
2527
2531
return ;
2528
2532
}
2529
2533
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
-
2534
+ const searchPaths = this . getGlobalPluginSearchPaths ( ) ;
2534
2535
if ( this . projectService . allowLocalPluginLoads ) {
2535
2536
const local = getDirectoryPath ( this . canonicalConfigFilePath ) ;
2536
2537
this . projectService . logger . info ( `Local plugin loading enabled; adding ${ local } to search paths` ) ;
0 commit comments