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 摘要。