Skip to content

Commit 74f5663

Browse files
authored
Extend readme with basic low level usage instructions (#327)
May be helpful for people who try to use java-debug with other clients than Visual Studio Code.
1 parent 0207219 commit 74f5663

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,36 @@ mvnw.cmd clean install
3535
./mvnw clean install
3636
```
3737

38+
39+
## Usage with eclipse.jdt.ls
40+
41+
To use `java-debug` as a [jdt.ls](https://github.com/eclipse/eclipse.jdt.ls) plugin, an [LSP client](https://langserver.org/) has to launch [jdt.ls](https://github.com/eclipse/eclipse.jdt.ls) with `initializationOptions` that contain the path to the built `java-debug` jar within a `bundles` array:
42+
43+
44+
```
45+
{
46+
"initializationOptions": {
47+
"bundles": [
48+
"path/to/microsoft/java-debug/com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin-<version>.jar"
49+
]
50+
}
51+
}
52+
```
53+
54+
Editor extensions like [vscode-java](https://github.com/redhat-developer/vscode-java) take care of this.
55+
56+
57+
Once `eclipse.jdt.ls` launched, the client can send a [Command](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#command) to the server to start a debug session:
58+
59+
```
60+
{
61+
"command": "vscode.java.startDebugSession"
62+
}
63+
```
64+
65+
The response to this request will contain a port number on which the debug adapter is listening, and to which a client implementing the debug-adapter protocol can connect to.
66+
67+
3868
License
3969
-------
4070
EPL 1.0, See [LICENSE](LICENSE.txt) file.

0 commit comments

Comments
 (0)