diff options
| author | Chris Kipp <ckipp@pm.me> | 2021-02-24 17:23:47 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-24 17:23:47 +0100 |
| commit | 7d82aaa6f5a6403f3c4e330dcaba9bb36ecbef28 (patch) | |
| tree | 2008cb3fe6784d12fc003b79224e55ff164e0ba9 /runtime/doc | |
| parent | d290da70b76a2dcd99591ec1a175a4ae29f64bfd (diff) | |
| download | rneovim-7d82aaa6f5a6403f3c4e330dcaba9bb36ecbef28.tar.gz rneovim-7d82aaa6f5a6403f3c4e330dcaba9bb36ecbef28.tar.bz2 rneovim-7d82aaa6f5a6403f3c4e330dcaba9bb36ecbef28.zip | |
[LSP] Add in more docs for highlight groups with document_highlight() (#13614)
Currently it's not 100% clear that without setting these, using the autocomds
to utilize the `textDocument/documentHighlight` functionality, nothing will
actually be visible since the highlight groups don't have any details. This
just adds in a couple simple extra notes to make sure that's done
Diffstat (limited to 'runtime/doc')
| -rw-r--r-- | runtime/doc/lsp.txt | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 06666c3a27..e4350576a4 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -397,6 +397,11 @@ LSP HIGHLIGHT *lsp-highlight* Reference Highlights: +Highlight groups that are meant to be used by |vim.lsp.buf.document_highlight()|. + +You can see more about the differences in types here: +https://microsoft.github.io/language-server-protocol/specification#textDocument_documentHighlight + *hl-LspReferenceText* LspReferenceText used for highlighting "text" references *hl-LspReferenceRead* @@ -932,15 +937,21 @@ definition() *vim.lsp.buf.definition()* Jumps to the definition of the symbol under the cursor. document_highlight() *vim.lsp.buf.document_highlight()* - 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: + Send request to the server to resolve document highlights for + the current text document position. This request can be + triggered by a key mapping or by events such as `CursorHold` , + eg: > 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()]] < + Note: Usage of |vim.lsp.buf.document_highlight()| requires the + following highlight groups to be defined or you won't be able + to see the actual highlights. |LspReferenceText| + |LspReferenceRead| |LspReferenceWrite| + document_symbol() *vim.lsp.buf.document_symbol()* Lists all symbols in the current buffer in the quickfix window. |