nvim-lspconfig icon indicating copy to clipboard operation
nvim-lspconfig copied to clipboard

add .git to jdtls root_files

Open MarcThu opened this issue 2 years ago • 4 comments

I have added ".git" into the root_files from jdtls, so that projects without ant, maven or gradle also get recognized by jdtls as a project. With this change, I was able to fix it for myself, so I wanted to share that.

This is my first contribution, so please tell me if I should improve things in the future, when contributing.

MarcThu avatar Jul 06 '22 12:07 MarcThu

Changed commit message, to fulfil conventional commit style.

MarcThu avatar Jul 06 '22 13:07 MarcThu

how is the lsp server supposed to work without a project file?

justinmk avatar Jul 06 '22 14:07 justinmk

I don't know if I misunderstood something, but the change does work in my case with lunar vim.

Before the change, my plain java project did not get recognized, and I was limited to just syntax errors and not for reference checks across the whole project.

As I didn't work much with java (just at university in simple projects) I did not work with maven or something else. I don't know If adding .git breaks something if there is another root_file as well.

MarcThu avatar Jul 06 '22 19:07 MarcThu

same problem would then occur if .git is not found.

general question for all configs: why don't we fallback to vim.fn.getcwd() ?

justinmk avatar Jul 07 '22 12:07 justinmk