Merge pull request #308 from andwilley/docs/update-java-example
Add detail about potential troubleshooting. Recommend jsdls_extension…
This commit is contained in:
commit
4ac9785217
1 changed files with 19 additions and 3 deletions
22
README.md
22
README.md
|
|
@ -1426,16 +1426,20 @@ use it with Vimspector.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
* Tell YCM to load the debugger plugin and create a mapping, such as
|
* Tell YCM to load the debugger plugin. This should be the `gadgets/<os>`
|
||||||
`<leader><F5>` to start the debug server and launch vimspector, e.g. in
|
directory, not any specific adapter. e.g. in `.vimrc`
|
||||||
`~/.vim/ftplugin/java.vim`:
|
|
||||||
|
|
||||||
```viml
|
```viml
|
||||||
" Tell YCM where to find the plugin. Add to any existing values.
|
" Tell YCM where to find the plugin. Add to any existing values.
|
||||||
let g:ycm_java_jdtls_extension_path = [
|
let g:ycm_java_jdtls_extension_path = [
|
||||||
\ '</path/to/Vimspector/gadgets/<os>'
|
\ '</path/to/Vimspector/gadgets/<os>'
|
||||||
\ ]
|
\ ]
|
||||||
|
```
|
||||||
|
|
||||||
|
* Create a mapping, such as `<leader><F5>` to start the debug server and launch
|
||||||
|
vimspector, e.g. in `~/.vim/ftplugin/java.vim`:
|
||||||
|
|
||||||
|
```viml
|
||||||
let s:jdt_ls_debugger_port = 0
|
let s:jdt_ls_debugger_port = 0
|
||||||
function! s:StartDebugging()
|
function! s:StartDebugging()
|
||||||
if s:jdt_ls_debugger_port <= 0
|
if s:jdt_ls_debugger_port <= 0
|
||||||
|
|
@ -1461,6 +1465,18 @@ nnoremap <silent> <buffer> <Leader><F5> :call <SID>StartDebugging()<CR>
|
||||||
|
|
||||||
You can then use `<Leader><F5>` to start debugging rather than just `<F5>`.
|
You can then use `<Leader><F5>` to start debugging rather than just `<F5>`.
|
||||||
|
|
||||||
|
If you see "Unable to get DAP port - is JDT.LS initialized?", try running
|
||||||
|
`:YcmCompleter ExecuteCommand vscode.java.startDebugSession` and note the
|
||||||
|
output. If you see an error like `ResponseFailedException: Request failed:
|
||||||
|
-32601: No delegateCommandHandler for vscode.java.startDebugSession`, make sure
|
||||||
|
that:
|
||||||
|
* Your YCM jdt.ls is actually working, see the
|
||||||
|
[YCM docs](https://github.com/ycm-core/YouCompleteMe#troubleshooting) for
|
||||||
|
troubleshooting
|
||||||
|
* The YCM jdt.ls has had time to initialize before you start the debugger
|
||||||
|
* That `g:ycm_java_jdtls_extension_path` is set in `.vimrc` or prior to YCM
|
||||||
|
starting
|
||||||
|
|
||||||
For the launch arguments, see the
|
For the launch arguments, see the
|
||||||
[vscode document](https://code.visualstudio.com/docs/java/java-debugging).
|
[vscode document](https://code.visualstudio.com/docs/java/java-debugging).
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue