diff --git a/support/test/java/test_project/.vimspector.json b/support/test/java/test_project/.vimspector.json index c19cfcb..39f4639 100644 --- a/support/test/java/test_project/.vimspector.json +++ b/support/test/java/test_project/.vimspector.json @@ -9,7 +9,10 @@ "classPaths": [ "${workspaceRoot}/target/classes" ], "args": "hello world!", "stopOnEntry": true, - "console": "integratedTerminal" + "console": "integratedTerminal", + "stepFilters": { + "skipClasses": [ "$$JDK" ] + } } }, "Java Attach": { @@ -19,7 +22,10 @@ "sourcePaths": [ "${workspaceRoot}/src/main/java" ], "stopOnEntry": true, "hostName": "localhost", - "port": "${JVMDebugPort}" + "port": "${JVMDebugPort}", + "stepFilters": { + "skipClasses": [ "$$JDK" ] + } } }, "Attach with vscode-javac": { diff --git a/support/test/java/test_project/java.vim b/support/test/java/test_project/java.vim new file mode 100644 index 0000000..96b78d8 --- /dev/null +++ b/support/test/java/test_project/java.vim @@ -0,0 +1,24 @@ +let g:ycm_java_jdtls_extension_path = [ + \ expand( ':p:h:h:h:h:h' ) . '/gadgets/macos' + \ ] + +let s:jdt_ls_debugger_port = 0 +function! s:StartDebugging() + if s:jdt_ls_debugger_port <= 0 + " Get the DAP port + let s:jdt_ls_debugger_port = youcompleteme#GetCommandResponse( + \ 'ExecuteCommand', + \ 'vscode.java.startDebugSession' ) + + if s:jdt_ls_debugger_port == '' + echom "Unable to get DAP port - is YCM initialized?" + let s:jdt_ls_debugger_port = 0 + return + endif + endif + + " Start debugging with the DAP port + call vimspector#LaunchWithSettings( { 'DAPPort': s:jdt_ls_debugger_port } ) +endfunction + +nnoremap :call StartDebugging() diff --git a/support/test/java/test_project/pom.xml b/support/test/java/test_project/pom.xml index e6dc4d3..890e7e8 100644 --- a/support/test/java/test_project/pom.xml +++ b/support/test/java/test_project/pom.xml @@ -4,7 +4,7 @@ TestApplication 1 - 11 - 11 + 8 + 8 diff --git a/support/test/java/test_project/src/main/java/com/vimspector/test/Base.java b/support/test/java/test_project/src/main/java/com/vimspector/test/Base.java new file mode 100644 index 0000000..25840d0 --- /dev/null +++ b/support/test/java/test_project/src/main/java/com/vimspector/test/Base.java @@ -0,0 +1,8 @@ +package com.vimspector.test; + +class Base { + public String DoSomething() + { + return ""; + } +} diff --git a/support/test/java/test_project/src/main/java/com/vimspector/test/TestApplication.java b/support/test/java/test_project/src/main/java/com/vimspector/test/TestApplication.java index 264c0e6..680dbb6 100644 --- a/support/test/java/test_project/src/main/java/com/vimspector/test/TestApplication.java +++ b/support/test/java/test_project/src/main/java/com/vimspector/test/TestApplication.java @@ -24,6 +24,16 @@ public class TestApplication { } } + private static class TestGeneric { + T t; + public TestGeneric( T t ) { + this.t = t; + } + public void DoSomethingUseful() { + System.out.println( t.DoSomething() ); + } + } + private static void DoGeneric( T b ) { TestGeneric foo = new TestGeneric<>( b ); foo.DoSomethingUseful();