LuaLS / LuaLS/lua-language-server

There are too many ways to toggle diagnostics

Ouverte
#1,364 17 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

enhancement
Langage dominant
Lua
Étoiles
4.4k
Forks
442
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Why is there 3 different ways to disable diagnostics?

The Problem

Currently, there is:

  • Lua.diagnostics.disable
    • An array of strings where you specify each diagnostic to disable
    • Simple, but has no control for open/closed files
  • Lua.diagnostics.neededFileStatus
    • An object where the key is the name of the diagnostic and the value is how the diagnostic will be checked (not at all, only open files, all files)
    • Slow but precise, allows you to alter the most diagnostics but can be slow to get everything set up the way you like it. Good for long-term setup where you can get set up perfectly.
  • Lua.diagnostics.groupFileStatus
    • An object where the key is the name of the group and the value is how the group of diagnostics will be checked (not at all, only open files, all files)
    • Quick but not precise, allows the user to quickly turn off entire categories of diagnostics but does not allow for disabling individual diagnostics. Good for short-term setup.

This can get very confusing very quickly.

The solution

I think going with just Lua.diagnostics.neededFileStatus would make the most sense.

It allows for the user to completely customize how the server runs, which is more important than the user quickly being able to get things working sort of how they like it in the short-term.

To still help get users up and running as fast as possible, we can offer "presets" or "popular configs" on the discussions page. This can help satisfy those that want just the basics or full strict mode.

This would definitely be a breaking change but I think it is a very important one to make!

Originally posted by @carsakiller in https://github.com/sumneko/lua-language-server/discussions/1362#discussioncomment-3194851

Guide de contribution

Ouvrir le guide de contribution

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.

Piste de recherche

Commencez par localiser les implémentations et la documentation de configuration de Lua.diagnostics.disable, Lua.diagnostics.neededFileStatus et Lua.diagnostics.groupFileStatus. Déterminez la portée du breaking change et la manière dont des presets ou des configurations courantes pourraient remplacer les options supprimées ; le travail est terminé lorsqu’un chemin de configuration cohérent est documenté et pris en charge.

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

Évaluation

Stack technique
lua
Domaine
tooling
Type d'issue
Refactorisation
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

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