buffer lsp reference highlight #88

pull/96/head
ray-x 3 years ago
parent 0a5db66968
commit 36c01adc2d

@ -138,11 +138,13 @@ local function before(r1, r2)
end
local handle_document_highlight = mk_handler(function(_, result, ctx)
trace(result)
if not ctx.bufnr then
log("ducment highlight error", result, ctx)
return
end
if type(result) ~= "table" then
log("clear up")
vim.lsp.util.buf_clear_references(ctx.bufnr)
return
end
@ -151,6 +153,7 @@ local handle_document_highlight = mk_handler(function(_, result, ctx)
return before(a.range, b.range)
end)
references[ctx.bufnr] = result
vim.lsp.util.buf_highlight_references(ctx.bufnr, result)
end)
-- modify from vim-illuminate
local function goto_adjent_reference(opt)

Loading…
Cancel
Save