@@ -62,6 +62,8 @@ export class StandardLanguageClient {
6262 serverStatusBarProvider . setBusy ( ) ;
6363 } else if ( status === ServerStatusKind . Error ) {
6464 serverStatusBarProvider . setError ( ) ;
65+ } else if ( status === ServerStatusKind . Warning ) {
66+ serverStatusBarProvider . setWarning ( ) ;
6567 } else {
6668 serverStatusBarProvider . setReady ( ) ;
6769 }
@@ -116,12 +118,23 @@ export class StandardLanguageClient {
116118 apiManager . updateStatus ( ClientStatus . Error ) ;
117119 resolve ( apiManager . getApiInstance ( ) ) ;
118120 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 ;
119130 case 'Starting' :
120131 case 'Message' :
121132 // message goes to progress report instead
122133 break ;
123134 }
124- serverStatusBarProvider . updateTooltip ( report . message ) ;
135+ if ( ! serverStatus . hasErrors ( ) ) {
136+ serverStatusBarProvider . updateTooltip ( report . message ) ;
137+ }
125138 } ) ;
126139
127140 this . languageClient . onNotification ( ProgressReportNotification . type , ( progress ) => {
@@ -453,22 +466,31 @@ export class StandardLanguageClient {
453466async function showImportFinishNotification ( context : ExtensionContext ) {
454467 const neverShow : boolean | undefined = context . globalState . get < boolean > ( "java.neverShowImportFinishNotification" ) ;
455468 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 ) ;
459485 }
460486
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" ) ;
464493 }
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- } ) ;
472494 }
473495}
474496
0 commit comments