Skip to content

Commit 7dd611a

Browse files
authored
Merge pull request #3232 from phanen/fix-empty-hover
fix: don't return empty hover
2 parents bedb6aa + 887dd36 commit 7dd611a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* `CHG` Rename configuration option `Lua.diagnostics.disableScheme` to `Lua.diagnostics.validScheme` and improve its description. Now it enables diagnostics for Lua files that use the specified scheme.
77
* `FIX` adds the `|lambda|` operator to the `Lua.runtime.nonstandardSymbol` configuration template, which allows the use of that option. Previously, support for it existed in the parser, but we could not actually use the option because it is not recognised in the configuration.
88
* `FIX` Typed `@field` (eg `---@field [string] boolean`) should not override other defined field [#2171](https://github.com/LuaLS/lua-language-server/issues/2171), [#2711](https://github.com/LuaLS/lua-language-server/issues/2711)
9+
* `FIX` don't return empty hover doc when luals failed to find definition
910

1011
## 3.15.0
1112
`2025-6-25`

script/provider/provider.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,13 @@ m.register 'textDocument/hover' {
369369
if not hover or not source then
370370
return nil
371371
end
372+
local value = tostring(hover)
373+
if #value == 0 then
374+
return nil
375+
end
372376
return {
373377
contents = {
374-
value = tostring(hover),
378+
value = value,
375379
kind = 'markdown',
376380
},
377381
range = converter.packRange(state, source.start, source.finish),

0 commit comments

Comments
 (0)