Skip to content

Commit

Permalink
perf(debug): don't create obj dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 6, 2024
1 parent 2f3b537 commit 1fe80c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lua/trouble/sources/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,9 @@ function M.results_to_items(client, results, default_uri)
local uri = result.location and result.location.uri or result.uri or default_uri
local loc = result.location or { range = result.selectionRange or result.range, uri = uri }
loc.uri = loc.uri or uri
assert(loc.uri, "missing uri in result:\n" .. vim.inspect(result))
if not loc.uri then
assert(loc.uri, "missing uri in result:\n" .. vim.inspect(result))
end
-- the range enclosing this symbol. Useful to get the symbol of the current cursor position
---@type lsp.Location?
local range = result.range and { range = result.range, uri = uri } or nil
Expand Down
4 changes: 3 additions & 1 deletion lua/trouble/tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ function M.build(items, section)
local node = root
for _, group in ipairs(section.groups) do
local builder = M.builders[group.directory and "directory" or "fields"]
assert(builder, "unknown group type: " .. vim.inspect(group))
if not builder then
assert(builder, "unknown group type: " .. vim.inspect(group))
end
node = builder.group(item, node, group)
end
node_items[node] = node_items[node] or {}
Expand Down

0 comments on commit 1fe80c7

Please sign in to comment.