LuaLS / LuaLS/lua-language-server

There are too many ways to toggle diagnostics

未关闭
#1,364 17 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

enhancement
主要语言
Lua
星标
4.4k
派生
442
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先定位 Lua.diagnostics.disable、Lua.diagnostics.neededFileStatus 和 Lua.diagnostics.groupFileStatus 的实现及配置文档。确定 breaking change 的范围,以及预设或常用配置如何替代已移除的选项;当一条一致的配置路径得到文档说明并受到支持时,这项工作就完成了。

由索引模型根据 Issue 内容生成。

评估

技术栈
lua
领域
tooling
Issue 类型
重构
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。