Skip to content

Commit

Permalink
fix: duplidate items in view finder
Browse files Browse the repository at this point in the history
  • Loading branch information
adalessa committed Mar 16, 2024
1 parent 66763be commit b56161f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/laravel/view_finder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ function M.go_to_definition()
for id, node in query:iter_captures(tree:root(), bufnr, 0, -1) do
if query.captures[id] == "view" then
local view = vim.treesitter.get_node_text(node, bufnr):gsub("'", "")
table.insert(founds, view)
founds[view] = true
end
end

founds = vim.tbl_keys(founds)

if #founds == 0 then
vim.notify("No usage of this view found", vim.log.levels.WARN)
return
Expand Down

0 comments on commit b56161f

Please sign in to comment.