Language server autocompletion doesn't appear to be working in new files
See original GitHub issueHi there,
At the moment I am looking to learn Java soon and hence trying to set up a Java autocomplete/suggestion setup in Vim with coc.nvim/coc-java in macOS Big Sur with openjdk16 installed through MacPorts. I have been encountering a slight issue in regards to autocompletion triggering for new files through vim, i.e. executing vim test.java
, where it seems that autcompletion doesn’t work.
What is odd is that there doesn’t seem to be any errors shown by Vim when this is happening, it seems that the language server is running, yet the autocomplete doesn’t kick in when I begin typing, as it would if i was to do so in something like vim test.c
or vim test.py
. With "java.trace.server": "verbose"
being set in my coc-settings.json file, doing :CocCommand workspace.showOutput java
appears to show that when I create and open a new file in Vim, it gets stuck on Building
when doing a 'language/progressReport
, which is referenced numerous times within the log. I haven’t been able to notice any explicit errors when doing :CocCommand java.open.serverLog
(there was one time where it did show a FileNotFoundException
, but I haven’t been able to replicate this.
Other things I’ve tried to do:
- Place
"java.home": "/Library/Java/JavaVirtualMachines/openjdk16/Contents/Home", "java.enabled": true, "java.completion.enabled": true
in my coc-settings.json file - Download and manually place the compiled jdt.ls files from Eclipse’s website into
~/.config/coc/extensions/coc-java-data/server
- Run
:CocCommand java.clean.workspace
All the above don’t appear to change the behaviour I am experiencing, with the exception of the java.clean.workspace
command - when this is run, it seems to get stuck on ‘starting coc.nvim service’.
I’m sorry if I’ve potentially overlooked anything, I’m still rather new to Java and coc.nvim! Would love to hear if anyone else has similar behaviour or might now a solution.
Thanks so much!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top GitHub Comments
Nice, I’ll make it an autocommand for every .java file. Thanks!
You can restart coc.nvim by
:CocRestart
after save the file.