3

For some reason after having a Java project open for more than 20 minutes, maybe a little more, the CTRL+Click shortcut to inspect classes/methods stops working. When clicking it only appears a loading indicator on the tabs section that keeps going forever without actually loading anything.

enter image description here

Another problem is that when hovering on a method it will stay on "Loading..." forever.

enter image description here

Strangely enough IntelliSense keeps working, so it will still give suggestions while writing.

I am using "Extension Pack for Java" latest version and latest version of VSCode. I am also using JavaSE-11.

Edit: maybe it's worth pointing out that I'm encountering this problem on a Spring Boot project.

shin
  • 333
  • 3
  • 11
  • I can not reproduce your problem, could you please try to clean the workspace through `java: Clean Java Language Server Workspace` in the command palette. And could you have a look at the Java-related channel on the `OUTPUT` panel? such as `Language Support for Java`, `Java` and so on. – Steven-MSFT Apr 04 '22 at 13:51
  • I did the clean but the problem still happens. In the output console for "Language Support for Java (Syntax Server)" there are these logs: [Trace - 1:17:37 PM] Sending response 'client/registerCapability - (7)'. Processing request took 1ms No result returned. [Trace - 1:17:54 PM] Sending request 'shutdown - (1)'. [Error - 1:17:55 PM] Connection to server got closed. Server will not be restarted. – shin Apr 06 '22 at 11:22
  • Have you configured `"java.jdt.ls.vmargs"` in the settings.json? And could you try to comment out all the settings in the settings.json file and then reopen the VSCode? – Steven-MSFT Apr 07 '22 at 02:15

3 Answers3

1

Have you installed the extension Lombok Annotations Support for VS Code? It can modify your "java.jdt.ls.vmargs" in the settings.json. Although you have uninstalled it, this configuration will not be removed.

Please check whether you have modified "java.jdt.ls.vmargs" in the settings.json.

If it still does not work please disable all the extensions and only enable the Java-related extensions, and clear the settings.json then to reopen the VSCode.

Steven-MSFT
  • 7,438
  • 1
  • 5
  • 13
  • Yes, I'm using that Lombok extension. I'll give it a try, thank you. In case that's the problem, is there a way to keep using that extension without encountering this problem? – shin Apr 07 '22 at 08:43
  • @antonio This is caused by some extensions, we only can pay attention to the configuration in the settings.json or remember to disable not related extensions when run across some weird problems. – Steven-MSFT Apr 07 '22 at 08:46
  • @antonio The problem has been solved? – Steven-MSFT Apr 13 '22 at 01:21
  • 1
    No, "java.jdt.ls.vmargs" doesn't seem to be the problem. I have uninstalled the lombok extension, deleted that setting from settings.json and cleaned java language server workspace. Like before, go to references worked for a while and then stopped working. Not to mention that I can't work without lombok support. It's really weird because this happens the same on multiple computers. I don't know if having more than one vscode instance open may be involved in the problem. – shin Apr 13 '22 at 12:18
1

I had the same problem in the past! So it was because VS Code can't use OpenJDK for its own work. More precisely, it works, but not all plugins work correctly. For VS Code you have to install Oracle JDK particular version and make configured JAVA_HOME environment variable as path to this Oracle JDK. After that you need to restart your VS Code. So, OracleJDK will be used only for VSCode, but if you need, inside your project you can use OpenJDK without any problems.

SmolRise
  • 41
  • 2
  • Setting JAVA_HOME wasn't enough for me. My default JDK in vscode was java8 but java11 was required. I had to set `java.configuration.runtimes` in `settings.json`. Example here : https://stackoverflow.com/a/73146672/7727575 – Sébastien Temprado Aug 29 '23 at 07:07
1

VSCode "go to definition" not working I had a the same issue: F12 and Ctrl + Click and Right Click "Go To Definition" wasn't working. The fix for me was:

Go to Extensions Click "Disable All Installed Extensions" Close and Reopen VS Code Back to Extensions and "Enable All Extensions" Essentially enable/disable all extensions fixed the issue.

Kritarth Sharma
  • 356
  • 2
  • 7