I'm using jdt.ls via [LanguageClient-neovim](https://github.com/autozimu/Languag…eClient-neovim), and I'm trying to use code actions. This is my file:
```java
public class App {
public static void main(String[] args) {
JFrame frame = new JFrame();
}
}
```
`JFrame` is linted because I did not import it, and the LS suggests some code actions(this is from the log of the client - I just formatted the JSON lines to make them readable):
```json
17:06:19 INFO [MainThread] Begin textDocument/codeAction
17:06:19 DEBUG [MainThread] =>
{
"jsonrpc": "2.0",
"id": 1,
"method": "textDocument/codeAction",
"params": {
"textDocument": {
"uri": "file:///files/tests/java/45/src/main/java/App.java"
},
"range": {
"start": {
"line": 2,
"character": 8
},
"end": {
"line": 2,
"character": 14
}
},
"context": {
"diagnostics": [
{
"range": {
"start": {
"line": 2,
"character": 8
},
"end": {
"line": 2,
"character": 14
}
},
"severity": 1,
"code": "16777218",
"source": "Java",
"message": "JFrame cannot be resolved to a type"
}
]
}
}
}
17:06:19 DEBUG [RPC-java ] <= {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Oct 3, 2017 5:05:52 PM \u003e\u003e document/codeAction"}}
17:06:19 DEBUG [RPC-java ] <=
{
"jsonrpc": "2.0",
"id": "1",
"result": [
{
"title": "Change to 'JobName' (javax.print.attribute.standard)",
"command": "java.apply.workspaceEdit",
"arguments": [
{
"changes": {
"file:///files/tests/java/45/src/main/java/App.java": [
{
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 0,
"character": 0
}
},
"newText": "import javax.print.attribute.standard.JobName;"
},
{
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 0,
"character": 0
}
},
"newText": "\n\n"
},
{
"range": {
"start": {
"line": 2,
"character": 8
},
"end": {
"line": 2,
"character": 8
}
},
"newText": "JobName"
},
{
"range": {
"start": {
"line": 2,
"character": 8
},
"end": {
"line": 2,
"character": 14
}
},
"newText": ""
}
]
}
}
]
},
{
"title": "Import 'JFrame' (javax.swing)",
"command": "java.apply.workspaceEdit",
"arguments": [
{
"changes": {
"file:///files/tests/java/45/src/main/java/App.java": [
{
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 0,
"character": 0
}
},
"newText": "import javax.swing.JFrame;"
},
{
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 0,
"character": 0
}
},
"newText": "\n\n"
}
]
}
}
]
},
{
"title": "Add type parameter 'JFrame' to 'main(String[])'",
"command": "java.apply.workspaceEdit",
"arguments": [
{
"changes": {
"file:///files/tests/java/45/src/main/java/App.java": [
{
"range": {
"start": {
"line": 1,
"character": 18
},
"end": {
"line": 1,
"character": 18
}
},
"newText": "<"
},
{
"range": {
"start": {
"line": 1,
"character": 18
},
"end": {
"line": 1,
"character": 18
}
},
"newText": "JFrame"
},
{
"range": {
"start": {
"line": 1,
"character": 18
},
"end": {
"line": 1,
"character": 18
}
},
"newText": "> "
}
]
}
}
]
}
]
}
17:06:19 DEBUG [MainThread] state.codeActionCommands: [] =>
[
{
"title": "Change to 'JobName' (javax.print.attribute.standard)",
"command": "java.apply.workspaceEdit",
"arguments": [
{
"changes": {
"file:///files/tests/java/45/src/main/java/App.java": [
{
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 0,
"character": 0
}
},
"newText": "import javax.print.attribute.standard.JobName;"
},
{
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 0,
"character": 0
}
},
"newText": "\n\n"
},
{
"range": {
"start": {
"line": 2,
"character": 8
},
"end": {
"line": 2,
"character": 8
}
},
"newText": "JobName"
},
{
"range": {
"start": {
"line": 2,
"character": 8
},
"end": {
"line": 2,
"character": 14
}
},
"newText": ""
}
]
}
}
]
},
{
"title": "Import 'JFrame' (javax.swing)",
"command": "java.apply.workspaceEdit",
"arguments": [
{
"changes": {
"file:///files/tests/java/45/src/main/java/App.java": [
{
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 0,
"character": 0
}
},
"newText": "import javax.swing.JFrame;"
},
{
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 0,
"character": 0
}
},
"newText": "\n\n"
}
]
}
}
]
},
{
"title": "Add type parameter 'JFrame' to 'main(String[])'",
"command": "java.apply.workspaceEdit",
"arguments": [
{
"changes": {
"file:///files/tests/java/45/src/main/java/App.java": [
{
"range": {
"start": {
"line": 1,
"character": 18
},
"end": {
"line": 1,
"character": 18
}
},
"newText": "<"
},
{
"range": {
"start": {
"line": 1,
"character": 18
},
"end": {
"line": 1,
"character": 18
}
},
"newText": "JFrame"
},
{
"range": {
"start": {
"line": 1,
"character": 18
},
"end": {
"line": 1,
"character": 18
}
},
"newText": "> "
}
]
}
}
]
}
]
17:06:19 INFO [MainThread] End textDocument/codeAction
```
So I pick `Import 'JFrame' (javax.swing)`:
```json
17:06:44 INFO [MainThread] Begin workspace/executeCommand
17:06:44 DEBUG [MainThread] =>
{
"jsonrpc": "2.0",
"id": 2,
"method": "workspace/executeCommand",
"params": {
"command": "java.apply.workspaceEdit",
"arguments": [
{
"changes": {
"file:///files/tests/java/45/src/main/java/App.java": [
{
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 0,
"character": 0
}
},
"newText": "import javax.print.attribute.standard.JobName;"
},
{
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 0,
"character": 0
}
},
"newText": "\n\n"
},
{
"range": {
"start": {
"line": 2,
"character": 8
},
"end": {
"line": 2,
"character": 8
}
},
"newText": "JobName"
},
{
"range": {
"start": {
"line": 2,
"character": 8
},
"end": {
"line": 2,
"character": 14
}
},
"newText": ""
}
]
}
}
]
}
}
17:06:44 DEBUG [RPC-java ] <= {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Oct 3, 2017 5:05:52 PM \u003e\u003e workspace/executeCommand"}}
17:06:44 DEBUG [RPC-java ] <= {"jsonrpc":"2.0","id":"2","error":{"code":-32601,"message":"No delegateCommandHandler for java.apply.workspaceEdit"}}
17:06:44 ERROR [MainThread] {"jsonrpc": "2.0", "id": "2", "error": {"code": -32601, "message": "No delegateCommandHandler for java.apply.workspaceEdit"}}
17:06:44 INFO [MainThread] End workspace/executeCommand
```
And get the error message - `No delegateCommandHandler for java.apply.workspaceEdit`
The LSP specs does not seem to refer to `delegateCommandHandler`s, and from #346 it looks like it's jdt.ls' extension - but I don't see any instructions on how to use it.
So... what do I need to do to add support for it in a client?