@@ -73,7 +73,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
7373 try {
7474 // See https://github.com/microsoft/vscode-java-debug/issues/778
7575 // Merge the platform specific properties to the global config to simplify the subsequent resolving logic.
76- this . mergePlatformProperties ( folder , config ) ;
76+ this . mergePlatformProperties ( config , folder ) ;
7777 return this . resolveAndValidateDebugConfiguration ( folder , config ) ;
7878 } catch ( ex ) {
7979 utility . showErrorMessage ( {
@@ -110,7 +110,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
110110 const launchConfigs = mainClasses . map ( ( item ) => {
111111 return {
112112 ...defaultLaunchConfig ,
113- name : this . constructLaunchConfigName ( item . mainClass , item . projectName , cache ) ,
113+ name : this . constructLaunchConfigName ( item . mainClass , cache , item . projectName ) ,
114114 mainClass : item . mainClass ,
115115 projectName : item . projectName ,
116116 } ;
@@ -127,7 +127,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
127127 } ) ;
128128 }
129129
130- private mergePlatformProperties ( _folder : vscode . WorkspaceFolder , config : vscode . DebugConfiguration ) {
130+ private mergePlatformProperties ( config : vscode . DebugConfiguration , _folder ? : vscode . WorkspaceFolder ) {
131131 if ( config && platformName && config [ platformName ] ) {
132132 try {
133133 for ( const key of Object . keys ( config [ platformName ] ) ) {
@@ -140,7 +140,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
140140 }
141141 }
142142
143- private constructLaunchConfigName ( mainClass : string , projectName : string , cache : { [ key : string ] : any } ) {
143+ private constructLaunchConfigName ( mainClass : string , cache : { [ key : string ] : any } , projectName ?: string ) {
144144 const prefix = "Debug (Launch)-" ;
145145 let name = prefix + mainClass . substr ( mainClass . lastIndexOf ( "." ) + 1 ) ;
146146 if ( projectName !== undefined ) {
@@ -333,7 +333,8 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
333333 return Object . keys ( config ) . filter ( ( key : string ) => key !== "noDebug" ) . length === 0 ;
334334 }
335335
336- private async resolveLaunchConfig ( folder : vscode . Uri | undefined , config : vscode . DebugConfiguration ) : Promise < lsPlugin . IMainClassOption > {
336+ private async resolveLaunchConfig ( folder : vscode . Uri | undefined ,
337+ config : vscode . DebugConfiguration ) : Promise < lsPlugin . IMainClassOption | undefined > {
337338 if ( ! config . mainClass || this . isFile ( config . mainClass ) ) {
338339 const currentFile = config . mainClass || _ . get ( vscode . window . activeTextEditor , "document.uri.fsPath" ) ;
339340 if ( currentFile ) {
@@ -350,7 +351,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
350351 }
351352
352353 const containsExternalClasspaths = ! _ . isEmpty ( config . classPaths ) || ! _ . isEmpty ( config . modulePaths ) ;
353- const validationResponse = await lsPlugin . validateLaunchConfig ( folder , config . mainClass , config . projectName , containsExternalClasspaths ) ;
354+ const validationResponse = await lsPlugin . validateLaunchConfig ( config . mainClass , config . projectName , containsExternalClasspaths , folder ) ;
354355 if ( ! validationResponse . mainClass . isValid || ! validationResponse . projectName . isValid ) {
355356 return this . fixMainClass ( folder , config , validationResponse ) ;
356357 }
@@ -391,7 +392,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
391392 const selectedFix = await mainClassPicker . showQuickPick ( validationResponse . proposals ,
392393 "Please select main class<project name>." , false ) ;
393394 if ( selectedFix ) {
394- sendInfo ( null , {
395+ sendInfo ( "" , {
395396 fix : "yes" ,
396397 fixMessage : errors . join ( os . EOL ) ,
397398 } ) ;
0 commit comments