aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2022-12-08 10:55:09 -0700
committerGitHub <noreply@github.com>2022-12-08 10:55:09 -0700
commit9b14ad5fd9e15718aa938f7a426dddcc2edab4e3 (patch)
tree53d4bb16095fafb481aacdfe6e52febbfd66327c /runtime/doc
parent42009ac7df88bfffeea49a83e642fdc6cf9f9447 (diff)
parent9f035559defd9d575f37fd825954610065d9cf96 (diff)
downloadrneovim-9b14ad5fd9e15718aa938f7a426dddcc2edab4e3.tar.gz
rneovim-9b14ad5fd9e15718aa938f7a426dddcc2edab4e3.tar.bz2
rneovim-9b14ad5fd9e15718aa938f7a426dddcc2edab4e3.zip
Merge pull request #21100 from jdrouhard/lsp_semantic_tokens
LSP: semantic tokens support
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/lsp.txt49
-rw-r--r--runtime/doc/lua.txt1
-rw-r--r--runtime/doc/news.txt8
3 files changed, 58 insertions, 0 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 4c4403c38f..22593d8331 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -1320,6 +1320,55 @@ save({lenses}, {bufnr}, {client_id}) *vim.lsp.codelens.save()*
==============================================================================
+Lua module: vim.lsp.semantic_tokens *lsp-semantic_tokens*
+
+force_refresh({bufnr}) *vim.lsp.semantic_tokens.force_refresh()*
+ Force a refresh of all semantic tokens
+
+ Only has an effect if the buffer is currently active for semantic token
+ highlighting (|vim.lsp.semantic_tokens.start()| has been called for it)
+
+ Parameters: ~
+ • {bufnr} (nil|number) default: current buffer
+
+start({bufnr}, {client_id}, {opts}) *vim.lsp.semantic_tokens.start()*
+ Start the semantic token highlighting engine for the given buffer with the
+ given client. The client must already be attached to the buffer.
+
+ NOTE: This is currently called automatically by
+ |vim.lsp.buf_attach_client()|. To opt-out of semantic highlighting with a
+ server that supports it, you can delete the semanticTokensProvider table
+ from the {server_capabilities} of your client in your |LspAttach| callback
+ or your configuration's `on_attach` callback.
+
+ >lua
+
+ client.server_capabilities.semanticTokensProvider = nil
+<
+
+ Parameters: ~
+ • {bufnr} (number)
+ • {client_id} (number)
+ • {opts} (nil|table) Optional keyword arguments
+ • debounce (number, default: 200): Debounce token
+ requests to the server by the given number in
+ milliseconds
+
+stop({bufnr}, {client_id}) *vim.lsp.semantic_tokens.stop()*
+ Stop the semantic token highlighting engine for the given buffer with the
+ given client.
+
+ NOTE: This is automatically called by a |LspDetach| autocmd that is set up
+ as part of `start()`, so you should only need this function to manually
+ disengage the semantic token engine without fully detaching the LSP client
+ from the buffer.
+
+ Parameters: ~
+ • {bufnr} (number)
+ • {client_id} (number)
+
+
+==============================================================================
Lua module: vim.lsp.handlers *lsp-handlers*
hover({_}, {result}, {ctx}, {config}) *vim.lsp.handlers.hover()*
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 2682725167..5a1c186192 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -604,6 +604,7 @@ vim.highlight.priorities *vim.highlight.priorities*
Table with default priorities used for highlighting:
• `syntax`: `50`, used for standard syntax highlighting
• `treesitter`: `100`, used for tree-sitter-based highlighting
+ • `semantic_tokens`: `125`, used for LSP semantic token highlighting
• `diagnostics`: `150`, used for code analysis such as diagnostics
• `user`: `200`, used for user-triggered highlights such as LSP document
symbols or `on_yank` autocommands
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 881faaa84e..bd0d1cfc5b 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -39,6 +39,14 @@ NEW FEATURES *news-features*
The following new APIs or features were added.
+• Added support for semantic token highlighting to the LSP client. This
+ functionality is enabled by default when a client that supports this feature
+ is attached to a buffer. Opt-out can be performed by deleting the
+ `semanticTokensProvider` from the LSP client's {server_capabilities} in the
+ `LspAttach` callback.
+
+ See |lsp-semantic_tokens| for more information.
+
• |vim.treesitter.show_tree()| opens a split window showing a text
representation of the nodes in a language tree for the current buffer.