From a8b24b2a4c5c827d004e645edf70da7130898c66 Mon Sep 17 00:00:00 2001 From: glepnir Date: Sun, 4 Aug 2024 14:26:40 +0800 Subject: [PATCH] fix(lightbulb): check user_data.lsp not empty --- lua/lspsaga/codeaction/lightbulb.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lspsaga/codeaction/lightbulb.lua b/lua/lspsaga/codeaction/lightbulb.lua index a34786ee..429d5edd 100644 --- a/lua/lspsaga/codeaction/lightbulb.lua +++ b/lua/lspsaga/codeaction/lightbulb.lua @@ -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 {