From 2d47ce2af1a434e5642b7fe7dc6712a81aa86f81 Mon Sep 17 00:00:00 2001 From: Will Ehrendreich Date: Tue, 7 Nov 2023 15:41:58 -0600 Subject: [PATCH] fix(lua): lua's handling of error being sent as {} counted as true.. *sigh* --- lua/ionide/init.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lua/ionide/init.lua b/lua/ionide/init.lua index ce3921a..ebf6c36 100644 --- a/lua/ionide/init.lua +++ b/lua/ionide/init.lua @@ -667,7 +667,7 @@ end --see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentHighlight M["textDocument/documentHighlight"] = function(error, result, context, config) - if not error then + if result then vim.lsp.handlers["textDocument/documentHighlight"](error, result, context, config) end end @@ -680,11 +680,9 @@ M["textDocument/hover"] = function(error, result, context, config) -- .. "result is: \n" -- .. vim.inspect({ error or "", result or "", context or "", config or "" }) -- ) - if not error then - if result then - if result.content then - vim.lsp.handlers.hover(error or {}, result.content.message or {}, context or {}, config or {}) - end + if result then + if result.content then + vim.lsp.handlers.hover(error or {}, result.content.message or {}, context or {}, config or {}) end end -- vim.lsp.handlers.hover(error or {}, result or {}, context or {}, config or {})