From 2303d67d5f4df101ab1d54b1922efa8477267064 Mon Sep 17 00:00:00 2001 From: glepnir Date: Sun, 4 Aug 2024 16:57:35 +0800 Subject: [PATCH] fix(lightbulb): check user_data range --- lua/lspsaga/codeaction/lightbulb.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lspsaga/codeaction/lightbulb.lua b/lua/lspsaga/codeaction/lightbulb.lua index 429d5edd..6173bc4f 100644 --- a/lua/lspsaga/codeaction/lightbulb.lua +++ b/lua/lspsaga/codeaction/lightbulb.lua @@ -81,7 +81,7 @@ local function diagnostic_vim_to_lsp(diagnostics) ---@return lsp.Diagnostic return vim.tbl_map(function(diagnostic) local user_data = diagnostic.user_data or {} - if user_data.lsp and not vim.tbl_isempty(user_data.lsp) then + if user_data.lsp and not vim.tbl_isempty(user_data.lsp) and user_data.lsp.range then return user_data.lsp end return {