LuaLS / LuaLS/lua-language-server
Request textDocument/hover failed.
还没有人认领这个 Issue。
- 主要语言
- Lua
- 星标
- 4.4k
- 派生
- 442
- PR 合并指标
- 30 天内没有已合并 PR
描述
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
MacOS
What is the issue affecting?
Hover
Expected Behaviour
no errors when hover
Actual Behaviour
error popups when hover
[error][#0:script/vm/global.lua:640]: script/vm/global.lua:640: attempt to index a nil value (local 'source')
stack traceback:
script/vm/global.lua:640: in function 'vm.vm.getGlobalNode'
(...tail calls...)
script/vm/visible.lua:182: in field 'isVisible'
script/core/hover/table.lua:105: in upvalue 'getVisibleKeyMap'
script/core/hover/table.lua:188: in upvalue 'buildTable'
script/core/hover/label.lua:51: in function <script/core/hover/label.lua:46>
(...tail calls...)
script/core/hover/init.lua:37: in local 'addHover'
script/core/hover/init.lua:92: in upvalue 'getHover'
script/core/hover/init.lua:144: in field 'byUri'
script/provider/provider.lua:368: in function <script/provider/provider.lua:346>
[C]: in global 'xpcall'
script/proto/proto.lua:202: in function <script/proto/proto.lua:177>
Reproduction steps
---@alias namespace.B<T> A<T>
---@class namespace.C<T>
---@field _x T
---@class namespace.D<T>
---@class A<T>:namespace.C<T>,namespace.D<T>
local A = {}
hover on A
Additional Notes
No response
Log File
No response
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
在 Lua 代码片段中将鼠标悬停在 A 上以复现失败,然后从 script/vm/global.lua:640 开始,跟踪经过 script/vm/visible.lua:182 和 script/core/hover/table.lua:105 的调用。报告的 hover 请求不产生错误弹窗,并且仍返回复现所需的预期 hover 信息,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- lua
- 领域
- devtools
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 48/100