question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Language server autocompletion doesn't appear to be working in new files

See original GitHub issue

Hi 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:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
psereycommented, Jul 15, 2021

Nice, I’ll make it an autocommand for every .java file. Thanks!

1reaction
chemzqmcommented, Jul 15, 2021

You can restart coc.nvim by :CocRestart after save the file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IntelliSense in Visual Studio Code
Troubleshooting. If you find IntelliSense has stopped working, the language service may not be running. Try restarting VS Code and this should solve...
Read more >
VSCode not suggesting and autocompleting java code
Open VScode and go to Preferences -> Settings · Search java.configuration.runtimes · Select Edit in settings.json and paste the follwing:.
Read more >
Problem about Fortran Intellisense in vs code
I have Modern Fortran and Fortran Intellisense installed and also Fortran language ... will not be displayed, and the error will only appear...
Read more >
IntelliSense in Visual Studio - Microsoft Learn
Many aspects of IntelliSense are language-specific. ... To turn List Members off by default (so that it does not appear unless specifically ...
Read more >
Integrating Code Completion in Visual Studio Code - Strumenta
Automatic code completion, also known as IntelliSense, is an important part of ... We don't want to clash with Kotlin files supported by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found