LuaLS / LuaLS/lua-language-server
`runtime.version` isn't applied from `.luarc.json`
未关闭
还没有人认领这个 Issue。
- 主要语言
- Lua
- 星标
- 4.4k
- 派生
- 442
- PR 合并指标
- 30 天内没有已合并 PR
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 .luarc.json 配置和最小的 lspconfig.lua_ls.setup({}) 入口开始,然后跟踪 runtime.version 的加载方式,并将其与正常工作的 diagnostics 设置进行比较。在使用 LuaJIT 的 Neovim 中复现补全或跳转到定义;当标准库定义使用 Lua 5.1 而不是 Lua 5.4 时,即可认为问题已解决。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- lua, neovim
- 领域
- devtools
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100