From a9c223cc2265be0130f07ec3a816314146e1a0fa Mon Sep 17 00:00:00 2001 From: ray-x Date: Sun, 31 Jul 2022 23:17:03 +1000 Subject: [PATCH] de-duplicate --- lua/navigator/reference.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/navigator/reference.lua b/lua/navigator/reference.lua index 8d495be..426e06e 100644 --- a/lua/navigator/reference.lua +++ b/lua/navigator/reference.lua @@ -41,8 +41,10 @@ local ref_view = function(err, locations, ctx, cfg) end vim.list_extend(locations, definitions.result) end + if references and references.result and #references.result > 0 then local refs = references.result + vim.list_extend(locations, refs) for _, value in pairs(locations) do local vrange = value.range or { start = { line = 0 }, ['end'] = { line = 0 } } for i = 1, #refs, 1 do @@ -55,13 +57,11 @@ local ref_view = function(err, locations, ctx, cfg) end end end - vim.list_extend(locations, refs) end err = nil trace(locations) -- lets de-dup first 10 elements. some lsp does not recognize definition and reference difference locations = util.dedup(locations) - end -- log("num", num) -- log("bfnr", bufnr)