diff --git a/lua/lspsaga/libs.lua b/lua/lspsaga/libs.lua index 9cf403b..5443512 100644 --- a/lua/lspsaga/libs.lua +++ b/lua/lspsaga/libs.lua @@ -70,16 +70,20 @@ function libs.result_isempty(res) end for _, v in pairs(res) do if next(v) == nil then - return true + goto continue end if not v.result then - return true + goto continue end if next(v.result) == nil then - return true + goto continue end + if next(v.result) ~= nil then + return false + end + ::continue:: end - return false + return true end function libs.split_by_pathsep(text, start_pos) diff --git a/lua/lspsaga/provider.lua b/lua/lspsaga/provider.lua index 4ecdffe..aa95edb 100644 --- a/lua/lspsaga/provider.lua +++ b/lua/lspsaga/provider.lua @@ -35,7 +35,7 @@ local send_request = function(timeout) for i, response in ipairs(responses) do if type(response) == "table" then for _, res in pairs(response) do - if res.result then + if res.result and next(res.result) ~= nil then coroutine.yield(res.result, i) end end