@@ -62,6 +62,8 @@ export class StandardLanguageClient {
62
62
serverStatusBarProvider . setBusy ( ) ;
63
63
} else if ( status === ServerStatusKind . Error ) {
64
64
serverStatusBarProvider . setError ( ) ;
65
+ } else if ( status === ServerStatusKind . Warning ) {
66
+ serverStatusBarProvider . setWarning ( ) ;
65
67
} else {
66
68
serverStatusBarProvider . setReady ( ) ;
67
69
}
@@ -116,12 +118,23 @@ export class StandardLanguageClient {
116
118
apiManager . updateStatus ( ClientStatus . Error ) ;
117
119
resolve ( apiManager . getApiInstance ( ) ) ;
118
120
break ;
121
+ case 'ProjectStatus' :
122
+ if ( report . message === "WARNING" ) {
123
+ serverStatus . updateServerStatus ( ServerStatusKind . Warning ) ;
124
+ } else if ( report . message === "OK" ) {
125
+ this . status = ClientStatus . Started ;
126
+ serverStatus . errorResolved ( ) ;
127
+ serverStatus . updateServerStatus ( ServerStatusKind . Ready ) ;
128
+ }
129
+ return ;
119
130
case 'Starting' :
120
131
case 'Message' :
121
132
// message goes to progress report instead
122
133
break ;
123
134
}
124
- serverStatusBarProvider . updateTooltip ( report . message ) ;
135
+ if ( ! serverStatus . hasErrors ( ) ) {
136
+ serverStatusBarProvider . updateTooltip ( report . message ) ;
137
+ }
125
138
} ) ;
126
139
127
140
this . languageClient . onNotification ( ProgressReportNotification . type , ( progress ) => {
@@ -453,22 +466,31 @@ export class StandardLanguageClient {
453
466
async function showImportFinishNotification ( context : ExtensionContext ) {
454
467
const neverShow : boolean | undefined = context . globalState . get < boolean > ( "java.neverShowImportFinishNotification" ) ;
455
468
if ( ! neverShow ) {
456
- const projectUris : string [ ] = await commands . executeCommand < string [ ] > ( Commands . EXECUTE_WORKSPACE_COMMAND , Commands . GET_ALL_JAVA_PROJECTS ) ;
457
- if ( projectUris . length === 0 || ( projectUris . length === 1 && projectUris [ 0 ] . includes ( "jdt.ls-java-project" ) ) ) {
458
- return ;
469
+ let choice : string | undefined ;
470
+ const options = [ "Don't show again" ] ;
471
+ if ( serverStatus . hasErrors ( ) ) {
472
+ options . unshift ( "Show errors" ) ;
473
+ choice = await window . showWarningMessage ( "Errors occurred during import of Java projects." , ...options ) ;
474
+ } else {
475
+ const projectUris : string [ ] = await commands . executeCommand < string [ ] > ( Commands . EXECUTE_WORKSPACE_COMMAND , Commands . GET_ALL_JAVA_PROJECTS ) ;
476
+ if ( projectUris . length === 0 || ( projectUris . length === 1 && projectUris [ 0 ] . includes ( "jdt.ls-java-project" ) ) ) {
477
+ return ;
478
+ }
479
+
480
+ if ( extensions . getExtension ( "vscjava.vscode-java-dependency" ) ) {
481
+ options . unshift ( "View projects" ) ;
482
+ }
483
+
484
+ choice = await window . showInformationMessage ( "Projects are imported into workspace." , ...options ) ;
459
485
}
460
486
461
- const options = [ "Don't show again" ] ;
462
- if ( extensions . getExtension ( "vscjava.vscode-java-dependency" ) ) {
463
- options . unshift ( "View projects" ) ;
487
+ if ( choice === "Don't show again" ) {
488
+ context . globalState . update ( "java.neverShowImportFinishNotification" , true ) ;
489
+ } else if ( choice === "View projects" ) {
490
+ commands . executeCommand ( "javaProjectExplorer.focus" ) ;
491
+ } else if ( choice === "Show errors" ) {
492
+ commands . executeCommand ( "workbench.panel.markers.view.focus" ) ;
464
493
}
465
- window . showInformationMessage ( "Projects are imported into workspace." , ...options ) . then ( ( choice ) => {
466
- if ( choice === "Don't show again" ) {
467
- context . globalState . update ( "java.neverShowImportFinishNotification" , true ) ;
468
- } else if ( choice === "View projects" ) {
469
- commands . executeCommand ( "javaProjectExplorer.focus" ) ;
470
- }
471
- } ) ;
472
494
}
473
495
}
474
496
0 commit comments