@@ -36,6 +36,22 @@ class JavaLanguageClient extends AutoLanguageClient {
36
36
atom . config . set ( 'ide-java.server.errors.incompleteClasspath.severity' , 'ignore' )
37
37
} ,
38
38
'java.ignoreIncompleteClasspath.help' : ( ) => { shell . openExternal ( 'https://github.com/atom/ide-java/wiki/Incomplete-Classpath-Warning' ) } ,
39
+ 'java.projectConfiguration.status' : ( command , connection ) => {
40
+ // Arguments:
41
+ // - 0: Object containing build file URI
42
+ // - 1: 'disabled' for Never, 'interactive' for Now, 'automatic' for Always
43
+ const [ uri , status ] = command . arguments
44
+ const statusMap = {
45
+ 0 : 'disabled' ,
46
+ 1 : 'interactive' ,
47
+ 2 : 'automatic' ,
48
+ }
49
+ atom . config . set ( 'ide-java.server.configuration.updateBuildConfiguration' , statusMap [ status ] )
50
+
51
+ if ( status !== 0 ) {
52
+ connection . sendCustomRequest ( 'java/projectConfigurationUpdate' , uri )
53
+ }
54
+ }
39
55
}
40
56
41
57
// Migrate ide-java.errors.incompleteClasspathSeverity -> ide-java.server.errors.incompleteClasspath.severity
@@ -210,7 +226,16 @@ class JavaLanguageClient extends AutoLanguageClient {
210
226
}
211
227
212
228
preInitialization ( connection ) {
213
- connection . onCustom ( 'language/status' , ( e ) => this . updateStatusBar ( `${ e . type . replace ( / ^ S t a r t e d $ / , '' ) } ${ e . message } ` ) )
229
+ let started = false
230
+ connection . onCustom ( 'language/status' , ( status ) => {
231
+ if ( started ) return
232
+ this . updateStatusBar ( status . message )
233
+ // Additional messages can be generated after the server is ready
234
+ // that we don't want to show (for example, build refreshes)
235
+ if ( status . type === 'Started' ) {
236
+ started = true
237
+ }
238
+ } )
214
239
connection . onCustom ( 'language/actionableNotification' , ( notification ) => this . actionableNotification ( notification , connection ) )
215
240
}
216
241
0 commit comments