redhat-developer / redhat-developer/vscode-java

Opened class files in referenced libraries are not restored on restart

未关闭
#4,406 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug
主要语言
TypeScript
星标
2.3k
派生
547
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,在启用 workbench.editor.restoreEditors 的情况下复现该问题:创建一个 Gradle Java 项目,添加一个 JAR 依赖项,从 Java Projects 视图中打开一个类,然后重启 VS Code。跟踪 extension 和 extension host 对该编辑器的处理;当打开的类文件在重启后得到恢复时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, typescript
领域
tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。