diff --git a/changelog.md b/changelog.md index 32ca4c9ad..4598cebd8 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,7 @@ * `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. * `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. * `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) +* `FIX` don't return empty hover doc when luals failed to find definition ## 3.15.0 `2025-6-25` diff --git a/script/provider/provider.lua b/script/provider/provider.lua index 6d3d7d04d..1601c2acd 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -369,9 +369,13 @@ m.register 'textDocument/hover' { if not hover or not source then return nil end + local value = tostring(hover) + if #value == 0 then + return nil + end return { contents = { - value = tostring(hover), + value = value, kind = 'markdown', }, range = converter.packRange(state, source.start, source.finish),