Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Workspace Classpath is corrupted after restart #1941

Closed
clemenswasser opened this issue May 12, 2021 · 13 comments
Closed

Code Workspace Classpath is corrupted after restart #1941

clemenswasser opened this issue May 12, 2021 · 13 comments

Comments

@clemenswasser
Copy link

  1. When I open a code-workspace with a clean Java Language Server Workspace everything works.
  2. Once I restart VSCode and open any file, I get the following warning SomeJavaClass.java is not on the classpath of project workspacename+some_random_hash, only syntax errors are reported
  3. When I execute Java: Clean Java Language Server Workspace we are back at 1.
Environment
  • Operating System: Windows 10
  • JDK version: 16.0.1.9
  • Visual Studio Code version: 1.56.1
  • Java extension version: 0.79.1
Steps To Reproduce
  1. Create a test.code-workspace file with the following contents:
    {
        "folders": [
            {
                "path": "test"
            }
        ]
    }
    
  2. Create folder test
  3. Create a file Test.java in that folder
  4. Open the code-workspace with VSCode
  5. Open test/Test.java in VSCode
  6. Everything works
  7. Execute Developer: Reload Window or restart VSCode
  8. Open test/Test.java in VSCode
  9. This Error appears and nothing works
  10. Execute Java: Clean Java Language Server Workspace and restart VSCode
  11. Everything works
Current Result

A restart of VSCode breaks the Java Language Server Workspace and Classpath

Expected Result

It shouldn't

Additional Informations
@rgrunber
Copy link
Member

I thought this might be similar to eclipse-jdtls/eclipse.jdt.ls#1764, but I'm not able to reproduce this issue. @snjeza let me know if you have any luck here.

@clemenswasser
Copy link
Author

I thought this might be similar to eclipse-jdtls/eclipse.jdt.ls#1764, but I'm not able to reproduce this issue. @snjeza let me know if you have any luck here.

I remember also experiencing the issue you linked.

@snjeza
Copy link
Contributor

snjeza commented May 12, 2021

@clemenswasser
Copy link
Author

I thought this might be similar to eclipse/eclipse.jdt.ls#1764, but I'm not able to reproduce this issue. @snjeza let me know if you have any luck here.

I have now reinstalled VSCode (including deleting configuration and cache) and am still able to reproduce this.
@snjeza Does this build that you posted contain a fix? Or why should I test it?

I have to add something:
I was previously using the Java Extension Pack and can still reproduce it using only Language Support for Java(TM) by Red Hat (redhat.java) and Project Manager for Java (vscjava.vscode-java-dependency).

@snjeza
Copy link
Contributor

snjeza commented May 12, 2021

Does this build that you posted contain a fix?

@clemenswasser Yes, it includes eclipse-jdtls/eclipse.jdt.ls#1766

@snjeza
Copy link
Contributor

snjeza commented May 12, 2021

I was previously using the Java Extension Pack and can still reproduce it using only Language Support for Java(TM) by Red Hat (redhat.java) and Project Manager for Java (vscjava.vscode-java-dependency).

I can reproduce the issue with VS Code 0.79.1, but can't with https://github.com/snjeza/vscode-test/raw/master/java-0.79.3.vsix

@clemenswasser
Copy link
Author

I have done some further investigations:
With the redhat.java extension standalone I cannot reproduce this.
Once I add any of the following extensions it does reproduce:

  • vscjava.vscode-java-test (+ vscjava.vscode-java-debug this is a dependency of the Test Runner extension)
  • vscjava.vscode-maven
  • vscjava.vscode-java-dependency

It is really weird. I can only reproduce it when other extensions (which are part of the Java Extension Pack) are activated too.

@snjeza
Copy link
Contributor

snjeza commented May 12, 2021

It is really weird. I can only reproduce it when other extensions (which are part of the Java Extension Pack) are activated too.

@clemenswasser Did you try https://github.com/snjeza/vscode-test/raw/master/java-0.79.3.vsix

@clemenswasser
Copy link
Author

It is really weird. I can only reproduce it when other extensions (which are part of the Java Extension Pack) are activated too.

@clemenswasser Did you try https://github.com/snjeza/vscode-test/raw/master/java-0.79.3.vsix

Sorry for not trying this directly. This solves the issue for me. Thank you very much 🥳
When will version 0.79.3 be released?

@snjeza
Copy link
Contributor

snjeza commented May 13, 2021

@clemenswasser
Copy link
Author

@clemenswasser Could you try https://github.com/snjeza/vscode-test/raw/master/java-0.79.4.vsix ?

This does also solve the issue for me.

@jdneo
Copy link
Collaborator

jdneo commented May 14, 2021

This should be fixed by eclipse-jdtls/eclipse.jdt.ls#1767 I guess. @snjeza @rgrunber

@rgrunber
Copy link
Member

rgrunber commented May 14, 2021

Yes, the change appears to resolve the issue. Cleaning the language server workspace, or reloading the window continue to work as well with the snippet provided.

This will be fixed in 0.79.2, which we expect to have out early next week. Feel free to re-open the issue though if the problem does persist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants