nvim --version: NVIM v0.5.0-812-gd17e50879:checkhealth result
jdtlsUbuntu 18.04.5 LTSgnome-terminal$TERM: xterm-256colorinit.vim
set runtimepath^=~/.local/share/nvim/plugged/nvim-lspconfig
lua << EOF
local nvim_lsp = require 'nvim_lsp'
local root_pattern = nvim_lsp.util.root_pattern
nvim_lsp.jdtls.setup{
root_dir = root_pattern(".git", "pom.xml"),
}
EOF
Main.java
public class Main {
public static void main(String[] args) {
ArrayList list = new ArrayList<>(); // ArrayList cannot be resolved to a type
}
}
Open file with nvim -u init.vim Main.java.
Place cursor on the first occurrence of ArrayList and use command :lua vim.lsp.buf.code_action().
Prompt with imports appears, select entry Import 'ArrayList' (java.util).
Import is not done.
Import is added on the top of the file.
Here's the log: lsp.log
This used to work before, I believe this happened when I updated neovim nightly.
Edit : Any action doesn't work actually.
I had same problem and this two lines of code change fixed my problem.
https://github.com/neovim/nvim-lspconfig/pull/429/files
Holy crap I ran into this just a day after you solved it. This solves it for me too!
Now that this has been resolved in https://github.com/neovim/nvim-lspconfig/pull/429#pullrequestreview-548216548, this ticket could be closed, right? @h-michael
Most helpful comment
I had same problem and this two lines of code change fixed my problem.
https://github.com/neovim/nvim-lspconfig/pull/429/files