Support java debugging
The java architecture is a little different: - the debugger is a jdt.ls extension bundle. - to start the server, you send a startDebugSession command to jdt.ls - this returns a tcl port to connect to for DAP Loading of jdt.ls and the extension are out of scope for vimspector currently and instead you can tell it to ask you for a port to connect to. After connexting to that port, vimspector works as normal. To support TCP/IP was pretty simple: we provide the same API from vimscript as the job-based (stdin/out) comms layer, but instead just directly use a channel. The only wrinkle was that the java debug adapter broke the protocol on runInTerminal and didn't return a 'cwd', so we make one up.
This commit is contained in:
parent
9f8fddd1cd
commit
14603ae72f
6 changed files with 173 additions and 7 deletions
4
support/test/java/test_project/.gitignore
vendored
Normal file
4
support/test/java/test_project/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
.classpath
|
||||
.project
|
||||
.settings/
|
||||
target/
|
||||
22
support/test/java/test_project/.vimspector.json
Normal file
22
support/test/java/test_project/.vimspector.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"adapters": {
|
||||
"java-debug-server": {
|
||||
"name": "vscode-java",
|
||||
"port": "ask"
|
||||
}
|
||||
},
|
||||
"configurations": {
|
||||
"Java Launch": {
|
||||
"adapter": "java-debug-server",
|
||||
"configuration": {
|
||||
"request": "launch",
|
||||
"mainClass": "com.vimspector.test.TestApplication",
|
||||
"sourcePaths": [ "${workspaceRoot}/src/main/java" ],
|
||||
"classPaths": [ "${workspaceRoot}/target/classes" ],
|
||||
"args": "hello world!",
|
||||
"stopOnEntry": true,
|
||||
"console": "integratedTerminal"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
10
support/test/java/test_project/pom.xml
Normal file
10
support/test/java/test_project/pom.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.vimspector.test</groupId>
|
||||
<artifactId>TestApplication</artifactId>
|
||||
<version>1</version>
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
</properties>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.vimspector.test;
|
||||
|
||||
public class TestApplication {
|
||||
public static void main( String[] args ) {
|
||||
for ( String s : args ) {
|
||||
System.out.println( "Arg: " + s );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue