Skip to content

Commit

Permalink
fix(lightbulb): check user_data.lsp not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir committed Aug 4, 2024
1 parent 7a1f796 commit a8b24b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/lspsaga/codeaction/lightbulb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ local function tags_vim_to_lsp(diagnostic)
end
return tags
end

local function diagnostic_vim_to_lsp(diagnostics)
---@param diagnostic vim.Diagnostic
---@return lsp.Diagnostic
return vim.tbl_map(function(diagnostic)
local user_data = diagnostic.user_data or {}
if user_data.lsp then
if user_data.lsp and not vim.tbl_isempty(user_data.lsp) then
return user_data.lsp
end
return {
Expand Down

0 comments on commit a8b24b2

Please sign in to comment.