LSP: implement documentHighlight (#11638)

* implement documentHighlight
* fix bug
* document highlight groups
* use uppercase for help section title
* documentation
This commit is contained in:
Alvaro Muñoz
2020-02-26 20:10:16 +01:00
committed by GitHub
parent 78ec95ce7d
commit ca8699378c
4 changed files with 69 additions and 17 deletions

View File

@@ -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