redhat-developer / redhat-developer/vscode-java
Intellisense only works when language server is in LightWeight mode.
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ả
Java Intellisense only works when the language server is in LightWeight mode. It breaks immediately every time I swap to Standard mode. (For me, this has been through use of Run/Debug.)
Possibly relevant excerpt from the language server's log:
!ENTRY org.eclipse.jdt.ls.core 4 0 2021-02-16 10:21:35.929
!MESSAGE file:///Users/jahorton/AlphaTiles/AlphaTilesEditor/src/main/java/org/alphatilesapps/alphatiles/data/Word.java does not resolve to a ICompilationUnit
It's definitely part of the project and is compiled as such
Environment
- Operating System: macOS 10.15.7
- JDK version: OpenJDK 13.0.1
- Visual Studio Code version: 1.53.2
- Java extension version: 0.75.0


The latter one (Visual Studio IntelliCode) is part of the Java Extension Pack, which also contains this extension, so I would expect compatibility.
Steps To Reproduce
Just to be explicit, this works for me from a clean reset, for which I do the following:
- Hit F1
- Java: Clean Java Language Server Workspace (then confirm yes to restart & delete)
After a reset, as long as it does reset to LightWeight mode, Intellisense works normally. Now, for the actual repro:
- Select Run/Debug - prompts with text below:
Run/Debug feature requires Java language server to run in Standard mode. Do you want to switch it to Standard mode now?
- Select Yes.
Intellisense is now completely broken, only capable of making raw-text suggestions based on common code-strings within the file.
Project experiencing the error: https://github.com/AlphaTiles/AlphaTilesEditor
- Happens whether or not a launch.json file (for run/debug launch configurations) is present.
A zip of the language server's .log file
- This one seemed to have more interesting detail, providing the excerpt seen earlier in this issue.
Current Result
Any use of Run/Debug necessitates a restart of the VS Code client in order to re-enable Intellisense.
Just to be clear, it doesn't matter whether or not the underlying type is from the JavaFX library, which would require an extra extension (see: JavaFX support); it even breaks for the basic String type.
Expected Result
Use of Run/Debug should have no impact whatsoever on Intellisense's ability to work.
Additional Informations
After trying a few more things to see if I could narrow down possible issues... I managed to somehow break the reset. The language server's no longer resetting to LightWeight mode for me, which is really disappointing.
Project details:
- Uses Gradle to build; is still a normal Java app, not an Android one.
- Uses JavaFX 11.0.1, which admittedly doesn't perfectly match the environment's JDK. Would prefer to support Java versions as old as 11 if possible, given that 11 is the latest LTS version of the OpenJDK.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- 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 việc đặt lại workspace sạch, chuyển từ LightWeight sang chế độ Standard thông qua Run/Debug và xem xét các log language server đính kèm để tìm lỗi phân giải ICompilationUnit. So sánh hành vi khi có và không có launch.json trong dự án Gradle được liên kết; được xem là hoàn tất khi IntelliSense tiếp tục hoạt động sau khi chuyển chế độ mà không cần khởi động lại VS Code.
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