Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3b55edc

Browse files
committed
fix: don't return empty hover
Nvim show me an error(since: neovim/neovim#34789), when I hover an symbol whose definition cannot be found by luals ``` **/neovim/runtime/lua/vim/lsp/util.lua:1685: 'width' key must be a positive Integer ``` To reprodunce, hover on a with this file ```lua ---@type a ``` Haven't reproduced with other lsp but I think it's harmless to PR here.
1 parent c2b2826 commit 3b55edc

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

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)

AltStyle によって変換されたページ (->オリジナル) /