Skip to content

Java language server starting all the time in vs code #238

Closed

Description

From internal user.

Hey, are you aware of an issue from any of the VS Code Java extensions where the java language server >starts and kills perf in code? I’m seeing this happening a lot and I’m not using any Java when it happens. >The lag is happening at really inopportune times especially when creating a debugger configuration. I’m >considering moving the Java stuff to the experimental instance, or isolate it somehow as its impacting >everything else.

We need investigate whether the issue related to the debug configuration generation or by java language server.

Activity

  1. robotdad commented on Feb 23, 2018

    @robotdad
    Member

    Here is a screenshot of what I'm seeing.
    image

    This is happening when I go to the debug mode and click add configuration. The problem is I'm editing C++ (or other files) and not Java when this occurs. When this occurs it causes the UI to not respond until the language service spins up. I'm just trying to create a c++ launch file but the Java extension is slowing it down.

  2. akaroml commented on Feb 26, 2018

    @akaroml
    Member

    This bug does not seem related to the debugger. Can we track this issue at vscode-java side? Yaohai Zheng (@yaohaizh)

  3. akaroml commented on Feb 26, 2018

    @akaroml
    Member

    Marc Goodner (@robotdad) Could you share the workspace (screenshots or directory/file list) to help us investigate?

    The Java language support should be activated when:

    1. A Java file is opened
    2. There is a pom.xml file in the root folder of your workspace
    3. User switched to Java language manually

    Does any of those cover your case?

  4. andxu commented on Mar 2, 2018

    @andxu
    Contributor

    need to be fixed at Vscode side, see discussions at microsoft/vscode#33803 and microsoft/vscode#37918 and microsoft/vscode#39696 microsoft/vscode#37929, in short, it is caused by introducing onDebugInitialConfigurations and onDebugResolve microsoft/vscode#39677, need to be fixed at vscode side for declarative value in package.json

  5. andxu commented on Mar 2, 2018

    @andxu
    Contributor

    Unfortunately, we use DebugConfigurationProvider to provide run-time initial debug configuration, which makes both our extension/java language server activated.

    Andre Weinand (@weinand) commented on Nov 11, 2017

    Most debug extensions contribute initial launch configs statically and declaratively through the package.json. In this case the DebugConfigurationProvider.provideDebugConfigurations isn't used and we could avoid the activation.

  6. andxu commented on Mar 20, 2018

    @andxu
    Contributor

    We can do little since vscode activates us at the early stage where I think a new declarative in package.json should be provided by vscode declaring we provides java runtime configuration. I will open a new issue at vscode tracking this issue.

  7. andxu commented on Apr 19, 2018

    @andxu
    Contributor

    Robert Alexander (@roalexan) Have you noticed that the new vscode-java has improved on the startup speed and ui to decrease the influence conflicting with other languages, eg: c++

  8. added
    votingPlease vote on the issue, so that we will take priority to this issue.
    on Jun 20, 2018
  9. akaroml commented on Jul 15, 2019

    @akaroml
    Member

    Time to actually fix this. Yan Zhang (@Eskibear)

  10. added and removed
    votingPlease vote on the issue, so that we will take priority to this issue.
    on Jul 15, 2019
  11. Eskibear commented on Jul 15, 2019

    @Eskibear
    Member

    The root cause is the dependency of the Java Extension (vscode-java). Whenever the debugger is activated (e.g. here when user presses F5, vscode needs to activate all debugger extensions to get available config templates), it activates Java Extension as well.

    I think the solution would be:

    • Remove the hard-coded extension dependency of vscode-java
    • Check the activation status of vscode-java whenever it need to call upsteaming APIs. If vscode-java is not activated (indicating no Java project is found in current workspace), the debugger should simply mute itself.

    With the proposed solution above, for the case mentiond in #238 (comment) , the Java Debugger related entries would not appear, and of course the vscode-java extension would not be activated as well.

  12. testforstephen commented on Aug 22, 2019

    @testforstephen
    Contributor

    The commit is merged. Will be released 0.21.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions