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

@ -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>