LuaLS / LuaLS/lua-language-server
`runtime.version` isn't applied from `.luarc.json`
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?
Linux
What is the issue affecting?
Completion
Expected Behaviour
It should look up definitions for LuaJIT (Lua 5.1).
Actual Behaviour
It looks up definitions for Lua 5.4.
Reproduction steps
- Having the following
.luarc.jsonin a project:
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"diagnostics": {
"globals": [ "after_each", "before_each", "describe", "it", "vim" ],
"disable": [ "redefined-local" ]
},
"runtime": {
"version": "LuaJIT"
},
"workspace": {
"library": [
"$VIMRUNTIME"
],
"checkThirdParty": false
}
}
- Open Neovim and edit a
.luafile - Go to definition for any standard library function
- Notice the version of the standard library used
Additional Notes
I'm using Neovim v0.10.1 with the native LSP.
I can reproduce this with a very simple config (no settings):
lspconfig.lua_ls.setup({})
One important thing to mention is that other settings like diagnostics are properly applied.
Log File
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the .luarc.json configuration and the minimal lspconfig.lua_ls.setup({}) entry point, then trace how runtime.version is loaded compared with the working diagnostics settings. Reproduce completion or go-to-definition in Neovim with LuaJIT, and consider the issue resolved when standard-library definitions use Lua 5.1 rather than Lua 5.4.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, neovim
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100