File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -760,8 +760,16 @@ namespace ts.server {
760760 const typingSafeListLocation = findArgument ( Arguments . TypingSafeListLocation ) ;
761761 const npmLocation = findArgument ( Arguments . NpmLocation ) ;
762762
763- const globalPlugins = ( findArgument ( "--globalPlugins" ) || "" ) . split ( "," ) ;
764- const pluginProbeLocations = ( findArgument ( "--pluginProbeLocations" ) || "" ) . split ( "," ) ;
763+ function parseStringArray ( argName : string ) : string [ ] {
764+ const arg = findArgument ( argName ) ;
765+ if ( arg === undefined ) {
766+ return emptyArray as string [ ] ; // TODO: https://github.com/Microsoft/TypeScript/issues/16312
767+ }
768+ return arg . split ( "," ) . filter ( name => name !== "" ) ;
769+ }
770+
771+ const globalPlugins = parseStringArray ( "--globalPlugins" ) ;
772+ const pluginProbeLocations = parseStringArray ( "--pluginProbeLocations" ) ;
765773 const allowLocalPluginLoads = hasArgument ( "--allowLocalPluginLoads" ) ;
766774
767775 const useSingleInferredProject = hasArgument ( "--useSingleInferredProject" ) ;
You can’t perform that action at this time.
0 commit comments