redhat-developer / redhat-developer/vscode-java
Reloading a window apprently clears Java project settings due to different workspace storage chosen
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ả
Environment
- Operating System: macOS (local host) + Linux (SSH remote host)
- JDK version: 17.0.9
- Visual Studio Code version: 1.89.1
- Java extension version: 1.31.0
Steps To Reproduce
- Open a large Java project on a remote machine with SSH remote development
- Configure the Java project, e.g. add some source paths
- Reload the window
Current Result
Configuration added in the step 2 is apparently lost.
Expected Result
Configuration added in the step 2 is kept.
Additional Informations
I found that the -data directory passed to jdt.ls differs before/after the reload.
- Before:
-data /usr/local/google/home/nya/.vscode-server/data/User/workspaceStorage/4f53a3d603ab9ba87f981c0821b0dc62/redhat.java/jdt_ws - After:
-data /usr/local/google/home/nya/.vscode-server/data/User/workspaceStorage/4f53a3d603ab9ba87f981c0821b0dc62-1/redhat.java/jdt_ws
Notice the -1 suffix added to the workspace storage directory.
In fact, a VSCode extension may receive different context.storageUri for the identical workspace when multiple instances of VSCode opens the workspace concurrently (c.f. https://github.com/microsoft/vscode/issues/128234). This can happen even on a window reload because a storage directory lock is released only on the VSCode process exit (https://github.com/microsoft/vscode/blob/5f646b8e67a869ef33061085ffe0e377d5ba040c/src/vs/workbench/api/node/extHostStoragePaths.ts#L52).
I guess this problem happens only in remote development because VSCode skips obtaining locks for local extension hosts (https://github.com/microsoft/vscode/issues/128528).
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 luồng tải lại SSH từ xa và so sánh context.storageUri của extension với đường dẫn -data của jdt.ls trước và sau khi tải lại. Xem xét hành vi được tham chiếu của VS Code extHostStoragePaths.ts và cách extension xử lý việc khởi chạy jdt.ls. Công việc được hoàn thành khi các thiết lập của dự án Java vẫn khả dụng sau khi tải lại thay vì bị chuyển sang một thư mục lưu trữ workspace -1.
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, tooling
- 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