redhat-developer / redhat-developer/vscode-java
Opened class files in referenced libraries are not restored on restart
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 546
- Avg merge
- 20h 1m
- Merged PRs (30d)
- 11
Description
Description
When workbench.editor.restoreEditors is enabled, opened project files are restored across VSCode restarts, but this does not work with opened class files from a referenced library.
This is fairly annoying when a project significantly involves some source-unavailable library.
To Reproduce
- Ensure
workbench.editor.restoreEditorsis enabled - Create a Java project (e.g. using Gradle)
- Add a JAR dependency
- Open a class file from the dependency in the "Java Projects" view
- Restart VSCode - The class file editor is not present
Having looked at trace-level logs for both this extension and the VSCode extension host, I do not believe they contain any useful information here (no clear consistent error message that seems related to this, and the class file itself is only mentioned once by this extension in the context of a large list of other classfiles that were not open prior to the restart). This issue has also persisted across multiple extension versions and devices, so I highly doubt it is a environment-related issue.
Expected behavior
The opened classfiles should remain open through restarts when workbench.editor.restoreEditors is enabled.
Environment
- Operating System: Windows 11
- JDK version: Oracle Java 24.0.2
- Visual Studio Code version: 1.117.0
- Java extension version: 1.54.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the case with workbench.editor.restoreEditors enabled: create a Gradle Java project, add a JAR dependency, open a class from the Java Projects view, and restart VS Code. Trace the extension and extension-host handling of that editor; done means the opened class file is restored after restart.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100