Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ class JavaLanguageClient extends AutoLanguageClient {
atom.config.set('ide-java.server.errors.incompleteClasspath.severity', 'ignore')
},
'java.ignoreIncompleteClasspath.help': () => { shell.openExternal('https://github.com/atom/ide-java/wiki/Incomplete-Classpath-Warning') },
'java.projectConfiguration.status': (command, connection) => {
// Arguments:
// - 0: Object containing build file URI
// - 1: 'disabled' for Never, 'interactive' for Now, 'automatic' for Always
const [uri, status] = command.arguments
const statusMap = {
0: 'disabled',
1: 'interactive',
2: 'automatic',
}
atom.config.set('ide-java.server.configuration.updateBuildConfiguration', statusMap[status])

if (status !== 0) {
connection.sendCustomRequest('java/projectConfigurationUpdate', uri)
}
}
}

// Migrate ide-java.errors.incompleteClasspathSeverity -> ide-java.server.errors.incompleteClasspath.severity
Expand Down Expand Up @@ -210,7 +226,16 @@ class JavaLanguageClient extends AutoLanguageClient {
}

preInitialization(connection) {
connection.onCustom('language/status', (e) => this.updateStatusBar(`${e.type.replace(/^Started$/, '')} ${e.message}`))
let started = false
connection.onCustom('language/status', (status) => {
if (started) return
this.updateStatusBar(status.message)
// Additional messages can be generated after the server is ready
// that we don't want to show (for example, build refreshes)
if (status.type === 'Started') {
started = true
}
})
connection.onCustom('language/actionableNotification', (notification) => this.actionableNotification(notification, connection))
}

Expand Down
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,30 @@
"title": "Language Server",
"description": "Settings that control language server functionality.",
"properties": {
"configuration": {
"type": "object",
"title": "Project Configuration",
"properties": {
"updateBuildConfiguration": {
"type": "string",
"title": "Update Build Configuration",
"enum": [
{"value": "disabled", "description": "Never"},
{"value": "interactive", "description": "Ask every time"},
{"value": "automatic", "description": "Always"}
],
"default": "interactive",
"description": "Whether to automatically update the project configuration when build files change."
}
}
},
"signatureHelp": {
"type": "object",
"title": "Signature Help",
"properties": {
"enabled": {
"type": "boolean",
"title": "Enabled",
"default": true,
"description": "Controls whether signature help is enabled."
}
Expand Down