redhat-developer / redhat-developer/vscode-java
Java extension pack does not work with Micronaut 4 applications.
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 2.3k
- 派生
- 546
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 11
描述
Environment
- Operating System: Ubuntu Linux 22.04, KDE desktop environment
- JDK version: "17.0.3.1" 2022-04-22 LTS
- Visual Studio Code version: 1.79.2
- Java extension version: 0.39.0
Steps To Reproduce
- open the project; install gradle + java extension pack, as suggested by vscode
- wait for the project loading to complete
- display Problems window
Projects created for Micronaut 3.10 (3.9.x) works OK, projects targetting Micronaut 4.x fail to work properly in vscode.
The sample projects are attached: demo4.zip (gradle Micronaut 4.0.1), demom4.zip
(maven Micronaut 4.0.1), demo2.zip(gradle, Micronaut 3.10-SNAPSHOT -- working). During testing and switching projects, the demo4 project appeared to load OK two times, but mostly fails. The seemingly successful opens were:
-
open demo2, then create new window and open demo4 there. Appeared without Problems once (further attempt failed with the reported problem)
-
open demo2, then Close Folder, and Open Folder demo4 in the current vscode (empty) window. (again, once seemed to load OK, other attempts fail)
In both successful cases, I can't say for sure the progress for "Opening Java projects" appeared at all, maybe the extension did not load fully (?) -
demo2.zip -- working
-
demo4.zip -- fails
-
demom4.zip -- fails too
Logs: jdtls.log
Current Result
Rebuild All or Rebuild Project actions fail.
The problems window shows the following messages:
[{
"resource": "/space/tmp/vsc4/src/demom4",
"owner": "_generated_diagnostic_collection_name_#2",
"code": "0",
"severity": 8,
"message": "The project was not built since its build path is incomplete. Cannot find the class file for io.micronaut.inject.visitor.TypeElementVisitor. Fix the build path then try building this project",
"source": "Java",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 1,
"endColumn": 1
}]
[{
"resource": "/space/tmp/vsc4/src/demo4/src/main/java/com/example4/Application.java",
"owner": "_generated_diagnostic_collection_name_#3",
"code": "16777563",
"severity": 8,
"message": "The type io.micronaut.inject.visitor.TypeElementVisitor cannot be resolved. It is indirectly referenced from required type io.micronaut.scheduling.async.validation.AsyncTypeElementVisitor",
"source": "Java",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 1,
"endColumn": 2
}]
The application fails to launch:
Expected Result
No problems :) or just normal code issues.
Additional Informations
Default (system) Java version:
java version "17.0.3.1" 2022-04-22 LTS
Java(TM) SE Runtime Environment (build 17.0.3.1+2-LTS-6)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.3.1+2-LTS-6, mixed mode, sharing)
vscode version:
Version: 1.79.2
Commit: 695af097c7bd098fbf017ce3ac85e09bbc5dda06
Date: 2023-06-14T08:59:55.818Z
Electron: 22.5.7
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 5.15.0-58-generic
Installed extensions:
redhat.java@1.20.0
VisualStudioExptTeam.intellicode-api-usage-examples@0.2.7
VisualStudioExptTeam.vscodeintellicode@1.2.30
vscjava.vscode-gradle@3.12.7
vscjava.vscode-java-debug@0.52.0
vscjava.vscode-java-dependency@0.23.0
vscjava.vscode-java-pack@0.25.12
vscjava.vscode-java-test@0.39.0
vscjava.vscode-maven@0.41.0
Suprisingly, opening the projects in Eclipse J2EE IDE shows no problems - screenshots of the Problems window:
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先使用附加的 demo4.zip 和 demom4.zip 项目重现失败,并将它们与正常工作的 demo2.zip 项目进行比较。检查 jdtls.log 输出以及围绕缺失的 io.micronaut.inject.visitor.TypeElementVisitor 类的 Rebuild Project 结果。当 Micronaut 4 Maven 和 Gradle 项目能够在 VS Code 中加载并重新构建,且没有报告的 Problems 诊断时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, typescript, vscode
- 领域
- developer-experience, devtools
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100