redhat-developer / redhat-developer/vscode-java

Corrupted workspace state on restart

未关闭
#390 32 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

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

描述

Every so often, when I close VS Code and I open it again later to continue working on the project, the Java Language Server (or some part of this extension) gets a corrupted build state. All my Java files get red-lined everywhere especially with imports (which should have been resolved correctly through Maven dependencies). It makes the entire Java project riddled with errors, when there should be 0 errors reported.

The workspace log file reports:
message: The project was not built since the source file /jdt.ls-java-project/src/com/example/package/SampleClass-6b2da599__18012WV3rlaskH3xV.java could not be read;code: 0

It looks like some kind of weird diff version of the original class file (perhaps generated from all the diffing I do while I work on my project. Looks like JLS thinks the diff file is an actual project file and keeps looking for it?

I tried to look inside this jdt.ls-java-project folder but I have no idea what's wrong. The file doesn't exist. I don't know how to fix this or how to force refresh JLS cache (if there's such a thing). Any hints and pointers will be very helpful. This is the second time I am getting this problem; I don't remember how I fixed it the first time or it just fixed itself somehow.

Environment
  • Operating System: Windows 10 x64
  • JDK version: 1.8.0_144
  • Visual Studio Code version: 1.18.1
  • Java extension version: 0.15.0
Steps To Reproduce

I'm not really sure. It just randomly happens when I close VS Code and open it later again.

Current Result

Weird build errors resulting in red-lining throughout the project.

Expected Result

Successfully built project every time.

Additional Information

None.

贡献指南

打开贡献指南

从这里开始

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

调研方向

从 workspace 日志条目开始,检查报告中提到的 jdt.ls-java-project 路径,尤其是缺失的 SampleClass-6b2da599__18012WV3rlaskH3xV.java 文件。如果可能,重现关闭并重新打开的操作序列,然后验证项目是否能够在没有缺失文件错误或出现红线标记的 Java 文件的情况下重新构建。

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

评估

技术栈
java, vscode
领域
devtools
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
28/100

把新 issue 发到你的邮箱

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