Provide an option to clear cache

Ouverte
#135 0 commentaires 3 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
30/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
java, rust
Domaine
tooling

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
Rust
Étoiles
225
Forks
47
Merge moyen
3 h 51 min
PR mergées (30 j)
7

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de zed-extensions/java

Toutes les issues de zed-extensions/java

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.