mirror of
https://github.com/Myzel394/jsonfly.nvim.git
synced 2025-06-18 04:05:26 +02:00
fix: Recursively parse arrays for lsp entries too
This commit is contained in:
parent
5b18e0bc04
commit
52d56f2e07
@ -90,6 +90,7 @@ end
|
||||
---@param result Symbol
|
||||
---@return string|number|table|boolean|nil
|
||||
function M:parse_lsp_value(result)
|
||||
-- Object
|
||||
if result.kind == 2 then
|
||||
local value = {}
|
||||
|
||||
@ -98,10 +99,13 @@ function M:parse_lsp_value(result)
|
||||
end
|
||||
|
||||
return value
|
||||
-- Integer
|
||||
elseif result.kind == 16 then
|
||||
return tonumber(result.detail)
|
||||
-- String
|
||||
elseif result.kind == 15 then
|
||||
return result.detail
|
||||
-- Array
|
||||
elseif result.kind == 18 then
|
||||
local value = {}
|
||||
|
||||
@ -110,8 +114,10 @@ function M:parse_lsp_value(result)
|
||||
end
|
||||
|
||||
return value
|
||||
-- null
|
||||
elseif result.kind == 13 then
|
||||
return nil
|
||||
-- boolean
|
||||
elseif result.kind == 17 then
|
||||
return result.detail == "true"
|
||||
end
|
||||
@ -159,7 +165,7 @@ function M:get_entries_from_lsp_symbols(symbols)
|
||||
}
|
||||
keys[#keys + 1] = entry
|
||||
|
||||
if symbol.kind == 2 then
|
||||
if symbol.kind == 2 or symbol.kind == 18 then
|
||||
local sub_keys = M:get_entries_from_lsp_symbols(symbol.children)
|
||||
|
||||
for jindex=1, #sub_keys do
|
||||
|
Loading…
x
Reference in New Issue
Block a user