From be99cbf84110e5172127ec45a3777c5af459b94e Mon Sep 17 00:00:00 2001 From: tris203 Date: Wed, 11 Sep 2024 21:48:22 +0100 Subject: [PATCH] docs(lsp): detail on hover window controls --- runtime/doc/lsp.txt | 8 +++++++- runtime/lua/vim/lsp/buf.lua | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index e820d54a9e..a2cc6da994 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -1397,7 +1397,13 @@ format({opts}) *vim.lsp.buf.format()* hover() *vim.lsp.buf.hover()* Displays hover information about the symbol under the cursor in a floating - window. Calling the function twice will jump into the floating window. + window. The window will be dismissed on cursor move. Calling the function + twice will will jump into the floating window (thus by default, "KK" will + open the hover window and focus it). In the floating window, all commands + and mappings are available as usual, except that "q" dismisses the window. + You can scroll the contents the same as you would any other buffer. Once + focused in the floating window, the buffer content can be scrolled as + usual implementation({opts}) *vim.lsp.buf.implementation()* Lists all the implementations for the symbol under the cursor in the diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua index a43ad8a690..7154a97631 100644 --- a/runtime/lua/vim/lsp/buf.lua +++ b/runtime/lua/vim/lsp/buf.lua @@ -29,7 +29,13 @@ local function request(method, params, handler) end --- Displays hover information about the symbol under the cursor in a floating ---- window. Calling the function twice will jump into the floating window. +--- window. The window will be dismissed on cursor move. +--- Calling the function twice will will jump into the floating window +--- (thus by default, "KK" will open the hover window and focus it). +--- In the floating window, all commands and mappings are available as usual, +--- except that "q" dismisses the window. +--- You can scroll the contents the same as you would any other buffer. +--- Once focused in the floating window, the buffer content can be scrolled as usual function M.hover() local params = util.make_position_params() request(ms.textDocument_hover, params)