aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/api.txt7
-rw-r--r--runtime/doc/lsp.txt28
-rw-r--r--runtime/lua/vim/lsp/buf.lua12
3 files changed, 41 insertions, 6 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 8ae5f415d4..fdc41af1d5 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -2195,6 +2195,13 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {opts})
• hl_group : name of the highlight group used to
highlight this mark.
• virt_text : virtual text to link to this mark.
+ • virt_text_pos : positioning of virtual text.
+ Possible values:
+ • "eol": right after eol character (default)
+ • "overlay": display over the specified
+ column, without shifting the underlying
+ text.
+
• ephemeral : for use with
|nvim_set_decoration_provider| callbacks. The
mark will only be used for the current redraw
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 06666c3a27..d2d88fb9ba 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.
@@ -1307,6 +1318,17 @@ on_publish_diagnostics({_}, {_}, {params}, {client_id}, {_}, {config})
• Update diagnostics in InsertMode or wait
until InsertLeave
+reset({client_id}, {buffer_client_map}) *vim.lsp.diagnostic.reset()*
+ Clear diagnotics and diagnostic cache
+
+ Handles saving diagnostics from multiple clients in the same
+ buffer.
+
+ Parameters: ~
+ {client_id} number
+ {buffer_client_map} table map of buffers to active
+ clients
+
save({diagnostics}, {bufnr}, {client_id}) *vim.lsp.diagnostic.save()*
Save diagnostics to the current buffer.
diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua
index 00219b6d98..31116985e2 100644
--- a/runtime/lua/vim/lsp/buf.lua
+++ b/runtime/lua/vim/lsp/buf.lua
@@ -310,15 +310,21 @@ function M.workspace_symbol(query)
request('workspace/symbol', 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:
+--- 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:
---
--- <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>
+---
+--- 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|
function M.document_highlight()
local params = util.make_position_params()
request('textDocument/documentHighlight', params)