redhat-developer / redhat-developer/vscode-java

Gradle multi-module project breaks on reload, requires cleaning Java Language Server workspace every time

Đang mở
#4,317 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

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ả

Description
I am working with a Java Gradle multi-module project in VS Code.
On the first load, the project fails with an error like:

The project was not built due to "xxx does not exist". Fix the problem, then try refreshing this project and building it since it may be inconsistent.

The suggested workaround is:

  • Disable Gradle for Java extension
  • Run "Java: Clean Java Language Server Workspace"
  • Reload the project

This workaround does fix the problem, but only temporarily.


Problem
Every time I:

  • reload the window, or
  • close and reopen the project

I have to run "Java: Clean Java Language Server Workspace" again, otherwise the same error appears.

This makes working with the project very inconvenient.


Expected behavior
Once the project is cleaned and loaded successfully:

  • It should stay in a consistent state
  • Reloading or reopening the project should not require cleaning the Java Language Server workspace again

Actual behavior

  • Project breaks again after reload
  • Same error repeats
  • Manual workspace cleaning is required every time

Environment

  • VS Code
  • Java multi-module Gradle project
  • Java Language Server
  • Gradle for Java extension enabled

Additional notes
This looks like a workspace cache or Gradle project import inconsistency issue.
It seems the Java Language Server does not correctly persist the resolved multi-module Gradle state across reloads.

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 trong VS Code với một dự án Java Gradle nhiều mô-đun, sử dụng extension Gradle for Java và Java Language Server. So sánh lần tải ban đầu với việc tải lại hoặc mở lại sau khi chạy "Java: Clean Java Language Server Workspace"; được xem là hoàn tất khi dự án vẫn nhất quán mà không cần dọn dẹp workspace lần nữa.

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, vscode
Lĩnh vực
build-system, developer-experience, tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
50/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.