redhat-developer / redhat-developer/vscode-java

Java extension pack does not work with Micronaut 4 applications.

Đang mở
#3,223 15 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

annotation-processing compile
Ngôn ngữ chính
TypeScript
Star
2.3k
Fork
546
Merge trung bình
20 giờ 1 phút
Pull request đã merge (30 ngày)
11

Mô tả

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
  1. open the project; install gradle + java extension pack, as suggested by vscode
  2. wait for the project loading to complete
  3. 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: micronaut-launch-failure

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:

  • micronaut-maven-eclipse
  • micronaut-gradle-eclipse

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện lỗi với các project demo4.zip và demom4.zip được đính kèm, đồng thời so sánh chúng với project demo2.zip đang hoạt động. Kiểm tra output của jdtls.log và kết quả của Rebuild Project liên quan đến class io.micronaut.inject.visitor.TypeElementVisitor bị thiếu. Công việc được xem là hoàn tất khi các project Maven và Gradle của Micronaut 4 được tải và rebuild trong VS Code mà không có các chẩn đoán Problems đã được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, typescript, vscode
Lĩnh vực
developer-experience, devtools
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.