Skip to content

Opened class files in referenced libraries are not restored on restart #4406

@Josh194

Description

@Josh194

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

  1. Ensure workbench.editor.restoreEditors is enabled
  2. Create a Java project (e.g. using Gradle)
  3. Add a JAR dependency
  4. Open a class file from the dependency in the "Java Projects" view
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions