LuaLS / LuaLS/lua-language-server

wrong document SymbolKind?

Open
#2,999 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in example.lua using :Telescope lsp_document_symbols, then trace the language server's document-symbol generation and its mapping to LSP 3.17 SymbolKind values. Done means opts is reported as Variable and the if statement is omitted rather than reported as Package.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.