summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md2
-rw-r--r--script/core/hover/init.lua3
-rw-r--r--test/crossfile/hover.lua19
3 files changed, 23 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md
index c17cdff0..8676660d 100644
--- a/changelog.md
+++ b/changelog.md
@@ -4,10 +4,12 @@
* `FIX` commandline parameter `checklevel` may not work
* `FIX` [#2036]
* `FIX` [#2037]
+* `FIX` [#2077]
* `FIX` [#2081]
[#2036]: https://github.com/LuaLS/lua-language-server/issues/2036
[#2037]: https://github.com/LuaLS/lua-language-server/issues/2037
+[#2077]: https://github.com/LuaLS/lua-language-server/issues/2077
[#2081]: https://github.com/LuaLS/lua-language-server/issues/2081
## 3.6.18
diff --git a/script/core/hover/init.lua b/script/core/hover/init.lua
index fb5f7cd5..ed596b3d 100644
--- a/script/core/hover/init.lua
+++ b/script/core/hover/init.lua
@@ -86,7 +86,8 @@ local function getHover(source)
else
addHover(source, true, oop)
for _, def in ipairs(vm.getDefs(source)) do
- if def.type == 'global' then
+ if def.type == 'global'
+ or def.type == 'setlocal' then
goto CONTINUE
end
if guide.isOOP(def) then
diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua
index 7763d643..d013af98 100644
--- a/test/crossfile/hover.lua
+++ b/test/crossfile/hover.lua
@@ -1776,3 +1776,22 @@ function foo(bar: any, baz: any)
@*param* `baz` — "dolor sit" this is ignored]]
}
+
+TEST { {path = 'a.lua', content = [[
+--comment1
+local x
+
+--comment2
+x = 1
+
+print(<?x?>)
+]]},
+hover = [[
+```lua
+local x: integer = 1
+```
+
+---
+
+comment1]]
+}