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