Fix up java test

This commit is contained in:
Ben Jackson 2020-07-11 14:06:32 +01:00
commit bdca96f663
5 changed files with 52 additions and 4 deletions

View file

@ -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": {

View file

@ -0,0 +1,24 @@
let g:ycm_java_jdtls_extension_path = [
\ expand( '<sfile>: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 <silent> <buffer> <Leader><F5> :call <SID>StartDebugging()<CR>

View file

@ -4,7 +4,7 @@
<artifactId>TestApplication</artifactId>
<version>1</version>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
</project>

View file

@ -0,0 +1,8 @@
package com.vimspector.test;
class Base {
public String DoSomething()
{
return "";
}
}

View file

@ -24,6 +24,16 @@ public class TestApplication {
}
}
private static class TestGeneric<T extends Base > {
T t;
public TestGeneric( T t ) {
this.t = t;
}
public void DoSomethingUseful() {
System.out.println( t.DoSomething() );
}
}
private static <T extends Base> void DoGeneric( T b ) {
TestGeneric<T> foo = new TestGeneric<>( b );
foo.DoSomethingUseful();