mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
LSP: implement documentHighlight (#11638)
* implement documentHighlight * fix bug * document highlight groups * use uppercase for help section title * documentation
This commit is contained in:
@@ -134,5 +134,23 @@ function M.references(context)
|
||||
request('textDocument/references', params)
|
||||
end
|
||||
|
||||
--- Send request to server to resolve document highlights for the
|
||||
--- current text document position. This request can be associated
|
||||
--- to key mapping or to events such as `CursorHold`, eg:
|
||||
---
|
||||
--- <pre>
|
||||
--- vim.api.nvim_command [[autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()]]
|
||||
--- vim.api.nvim_command [[autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()]]
|
||||
--- vim.api.nvim_command [[autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()]]
|
||||
--- </pre>
|
||||
function M.document_highlight()
|
||||
local params = util.make_position_params()
|
||||
request('textDocument/documentHighlight', params)
|
||||
end
|
||||
|
||||
function M.clear_references()
|
||||
util.buf_clear_references()
|
||||
end
|
||||
|
||||
return M
|
||||
-- vim:sw=2 ts=2 et
|
||||
|
Reference in New Issue
Block a user