LuaLS / LuaLS/lua-language-server

wrong document SymbolKind?

未关闭
#2,999 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

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

描述

How are you using the lua-language-server?

NeoVim

Which OS are you using?

MacOS

What is the issue affecting?

Annotations

Expected Behaviour

correct document symbol kinds as per https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#symbolKind

such as

  • function parameter (function(opts) end) opts: Variable
  • if: no symbol kind
Actual Behaviour

seemingly wrong symbol kinds

such as

  • opts: Constant
  • if: Package
Reproduction steps
  1. create example.lua file
local function config(opts)
  if opts then
    print('hello world')
  end
end
  1. inspect LSP document symbols (I used :Telescope lsp_document_symbols)
  2. notice wrong types for opts and if
Additional Notes

No response

Log File

No response

贡献指南

打开贡献指南

从这里开始

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

调研方向

在 example.lua 中使用 :Telescope lsp_document_symbols 复现该问题,然后跟踪语言服务器生成文档符号的过程,以及其到 LSP 3.17 SymbolKind 值的映射。完成标准是 opts 被报告为 Variable,且 if 语句被省略,而不是被报告为 Package。

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

评估

技术栈
lua
领域
devtools
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

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