Skip to content

Commit

Permalink
refactor: remove redundant includeDeclaration
Browse files Browse the repository at this point in the history
`includeDeclaration` is no longer necessary since switching to `textDocument/documentHighlight`
  • Loading branch information
mawkler committed Sep 4, 2024
1 parent b3f2cd7 commit 3b52f5f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lua/refjump/jump.lua
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,10 @@ function M.reference_jump_from(current_position, opts, count, references, with_r
end

local params = vim.lsp.util.make_position_params()
local context = { includeDeclaration = true }
params = vim.tbl_extend('error', params, { context = context })

-- We're callling `textDocument/documentHighlight` here instead of
-- We call `textDocument/documentHighlight` here instead of
-- `textDocument/references` for performance reasons. The latter searches the
-- entire workspace, and `textDocument/documentHighlight` only searches the
-- entire workspace, but `textDocument/documentHighlight` only searches the
-- current buffer, which is what we want.
vim.lsp.buf_request(0, 'textDocument/documentHighlight', params, function(err, refs, _, _)
if err then
Expand Down

0 comments on commit 3b52f5f

Please sign in to comment.