@@ -999,16 +999,22 @@ namespace ts.server {
999
999
if ( this . projectService . globalPlugins ) {
1000
1000
// Enable global plugins with synthetic configuration entries
1001
1001
for ( const globalPluginName of this . projectService . globalPlugins ) {
1002
+ // Skip empty names from odd commandline parses
1003
+ if ( ! globalPluginName ) continue ;
1004
+
1002
1005
// Skip already-locally-loaded plugins
1003
1006
if ( options . plugins && options . plugins . some ( p => p . name === globalPluginName ) ) continue ;
1004
1007
1005
1008
// Provide global: true so plugins can detect why they can't find their config
1009
+ this . projectService . logger . info ( `Loading global plugin ${ globalPluginName } ` ) ;
1006
1010
this . enablePlugin ( { name : globalPluginName , global : true } as PluginImport , searchPaths ) ;
1007
1011
}
1008
1012
}
1009
1013
}
1010
1014
1011
1015
private enablePlugin ( pluginConfigEntry : PluginImport , searchPaths : string [ ] ) {
1016
+ this . projectService . logger . info ( `Enabling plugin ${ pluginConfigEntry . name } from candidate paths: ${ searchPaths . join ( "," ) } ` ) ;
1017
+
1012
1018
const log = ( message : string ) => {
1013
1019
this . projectService . logger . info ( message ) ;
1014
1020
} ;
@@ -1020,7 +1026,7 @@ namespace ts.server {
1020
1026
return ;
1021
1027
}
1022
1028
}
1023
- this . projectService . logger . info ( `Couldn't find ${ pluginConfigEntry . name } anywhere in paths: ${ searchPaths . join ( "," ) } ` ) ;
1029
+ this . projectService . logger . info ( `Couldn't find ${ pluginConfigEntry . name } ` ) ;
1024
1030
}
1025
1031
1026
1032
private enableProxy ( pluginModuleFactory : PluginModuleFactory , configEntry : PluginImport ) {
@@ -1039,7 +1045,15 @@ namespace ts.server {
1039
1045
} ;
1040
1046
1041
1047
const pluginModule = pluginModuleFactory ( { typescript : ts } ) ;
1042
- this . languageService = pluginModule . create ( info ) ;
1048
+ const newLS = pluginModule . create ( info ) ;
1049
+ for ( const k of Object . keys ( this . languageService ) ) {
1050
+ if ( ! ( k in newLS ) ) {
1051
+ this . projectService . logger . info ( `Plugin activation warning: Missing proxied method ${ k } in created LS. Patching.` ) ;
1052
+ ( newLS as any ) [ k ] = ( this . languageService as any ) [ k ] ;
1053
+ }
1054
+ }
1055
+ this . projectService . logger . info ( `Plugin validation succeded` ) ;
1056
+ this . languageService = newLS ;
1043
1057
this . plugins . push ( pluginModule ) ;
1044
1058
}
1045
1059
catch ( e ) {
0 commit comments