Java debug configuration of vimspector width nvim-jdtls.
Vimspector provides java debug with YouCompleteMe, and nvim-jdtls provides java debug with nvim-dap. If you are using vimspector and nvim-jdtls as well, there is a little trouble to make them working together. That is what this plugin does.
Use your favorite plugin manager to install, eg:
Plug 'puremourning/vimspector'
Plug 'mfussenegger/nvim-jdtls'
Plug 'elementdavv/vimspector-jdtls'
With vimspector, install java gadget with ./install_gadget.py --force-enable-java
or :VimspectorInstall vscode-java-debug
. The gadget includes a java-debug-server file(vscode-java-debug/server/com.microsoft.java.debug.plugin-*.jar) that will be used in nvim-jdtls configuration.
With nvim-jdtls, download eclipse.jdt.ls, optional vscode-java-test, and optional google-java-format eclipse-formatter-xml.
Configure vimspector and nvim-jdtls as described in their documents.
This plugin does not need any configuration.
If you are using nvim-lspconfig, do not call lspconfig.jdtls.setup{}, else you will got two language server instances.
Refer to wiki for sample configurations.
To trigger java debug, call command:
VimspectorJdtlsStartDebug
The command has been mapped to <Leader><F5>(different than vimspector's default shortcut <F5>). You can remap to other keys as you like.
After a java debug session is started, all functions provided by vimspector and nvim-jdtls are all available.
GPL3 ©Element Davv
Any questions and/or suggestions are appreciatiated.