From ca5de9306c00d07cce1daef1f0038c937098bc66 Mon Sep 17 00:00:00 2001 From: Chinmay Dalal Date: Tue, 20 Jun 2023 11:36:54 +0530 Subject: feat(lsp): inlay hints #23984 Add automatic refresh and a public interface on top of #23736 * add on_reload, on_detach handlers in `enable()` buf_attach, and LspDetach autocommand in case of manual detach * unify `__buffers` and `hint_cache_by_buf` * use callback bufnr in `on_lines` callback, bufstate: remove __index override * move user-facing functions into vim.lsp.buf, unify enable/disable/toggle Closes #18086 --- runtime/doc/lsp.txt | 7 +++++++ runtime/doc/news.txt | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index ca4570e392..73691c0656 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -1296,6 +1296,13 @@ incoming_calls() *vim.lsp.buf.incoming_calls()* window. If the symbol can resolve to multiple items, the user can pick one in the |inputlist()|. +inlay_hint({bufnr}, {enable}) *vim.lsp.buf.inlay_hint()* + Enable/disable/toggle inlay hints for a buffer + + Parameters: ~ + • {bufnr} (integer) Buffer handle, or 0 for current + • {enable} (boolean|nil) true/false to enable/disable, nil to toggle + list_workspace_folders() *vim.lsp.buf.list_workspace_folders()* List workspace folders. diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index cd3b1bd45e..2a25edc4eb 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -93,8 +93,9 @@ The following new APIs and features were added. • |nvim_set_keymap()| and |nvim_del_keymap()| now support abbreviations. -• Added |lsp-handler| for inlay hints: `textDocument/inlayHint` and - `workspace/inlayHint/refresh` +• Implemented LSP inlay hints: |vim.lsp.buf.inlay_hint()| + https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_inlayHint + ============================================================================== CHANGED FEATURES *news-changed* -- cgit