mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
fix(lsp): empty commands should not be considered executable (#28216)
According to the LSP specification, the CodeLens.command is optional but the CodeLens.command.command is not optional, which means the correct representation of a display-only code lens is indeed one with a command with a title to display and an empty string as command.
This commit is contained in:
parent
49983387ff
commit
b95b6ed975
@ -79,7 +79,7 @@ function M.run()
|
|||||||
local lenses_by_client = lens_cache_by_buf[bufnr] or {}
|
local lenses_by_client = lens_cache_by_buf[bufnr] or {}
|
||||||
for client, lenses in pairs(lenses_by_client) do
|
for client, lenses in pairs(lenses_by_client) do
|
||||||
for _, lens in pairs(lenses) do
|
for _, lens in pairs(lenses) do
|
||||||
if lens.range.start.line == (line - 1) then
|
if lens.range.start.line == (line - 1) and lens.command and lens.command.command ~= '' then
|
||||||
table.insert(options, { client = client, lens = lens })
|
table.insert(options, { client = client, lens = lens })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user