Provide an option to clear cache

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

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

Đánh giá

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

Hướng nghiên cứu

Start in the function get_jdtls_data_path and in language_server_command, where the per-worktree JDTLS data directory is computed and launched. The issue proposes two options, a cache_key setting or a clear_cache_on_startup flag, and no decision has been recorded, so agree on one with the maintainers before editing. Done means the chosen option clears or rotates the JDTLS data directory and the change is documented in the extension's settings.

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

Mô tả

It sometimes happens that JDTLS's starts providing wrong diagnostics or suddenly doesn't give certain completions anymore. This is certainly a problem with JDTLS and it's interactions with Zed, but the remedy is usually to clear the cache and restart the language server and everything works fine again.
The problem is that there is currently no convenient way to do so.

We have get_jdtls_data_path which determines where JDTLS will store its project-level state. Currently, these are unique per worktree-root directory and stored in the system level cache folder. To manage them I see two options that we can use within the current Zed extension limitations:

  • have a config option "cache_key" : int that we use when generating the directory hash. This way we can simply increment the key to get a fresh cache. Cleaning up the old ones remains the system's responsibility. The nice thing here is this can be project-specific config, so you can keep the cache for one project and refresh them for another one
  • have a config option clear_cache_on_startup and manage the jdtls-data-paths inside our extension working directory, and just delete its contents every time language_server_command is called when the option is set.

I haven't done a lot of research if maybe JDTLS offers other ways to do this or if we should perhaps wait for/work on some Zed feature, so this is the place to discuss this.

Ngôn ngữ chính
Rust
Star
225
Fork
47
Merge trung bình
3 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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.

Issue khác của zed-extensions/java

Tất cả issue của zed-extensions/java

Issue tương tự

Thêm issue về Rust

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.