diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/autocmd.txt | 5 | ||||
-rw-r--r-- | runtime/doc/lsp.txt | 30 | ||||
-rw-r--r-- | runtime/doc/motion.txt | 2 | ||||
-rw-r--r-- | runtime/doc/recover.txt | 8 | ||||
-rw-r--r-- | runtime/lua/vim/lsp.lua | 17 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/inlay_hint.lua | 8 |
6 files changed, 39 insertions, 31 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index ce3af01073..e43574fe86 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -784,9 +784,6 @@ OptionSet After setting an option (except during are not global-local it is the old local value. - OptionSet is not triggered on startup and for - the 'key' option for obvious reasons. - Usage example: Check for the existence of the directory in the 'backupdir' and 'undodir' options, create the directory if it doesn't @@ -800,6 +797,8 @@ OptionSet After setting an option (except during Non-recursive: |:set| in the autocommand does not trigger OptionSet again. + Not triggered on startup. + *QuickFixCmdPre* QuickFixCmdPre Before a quickfix command is run (|:make|, |:lmake|, |:grep|, |:lgrep|, |:grepadd|, diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index e3fc616df4..ad1b838578 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -911,9 +911,8 @@ start({config}, {opts}) *vim.lsp.start()* • `name` arbitrary name for the LSP client. Should be unique per language server. - • `cmd` command (in list form) used to start the language server. Must be - absolute, or found on `$PATH`. Shell constructs like `~` are not - expanded. + • `cmd` command string[] or function, described at + |vim.lsp.start_client()|. • `root_dir` path to the project root. By default this is used to decide if an existing client should be re-used. The example above uses |vim.fs.find()| and |vim.fs.dirname()| to detect the root by traversing @@ -953,15 +952,16 @@ start_client({config}) *vim.lsp.start_client()* Parameters: ~ • {config} (`lsp.ClientConfig`) Configuration for the server: - • cmd: (string[]|fun(dispatchers: table):table) command a - list of strings treated like |jobstart()|. The command - must launch the language server process. `cmd` can also be - a function that creates an RPC client. The function - receives a dispatchers table and must return a table with - the functions `request`, `notify`, `is_closing` and - `terminate` See |vim.lsp.rpc.request()| and - |vim.lsp.rpc.notify()| For TCP there is a built-in rpc - client factory: |vim.lsp.rpc.connect()| + • cmd: (string[]|fun(dispatchers: table):table) command + string[] that launches the language server (treated as in + |jobstart()|, must be absolute or on `$PATH`, shell + constructs like "~" are not expanded), or function that + creates an RPC client. Function receives a `dispatchers` + table and returns a table with member functions `request`, + `notify`, `is_closing` and `terminate`. See + |vim.lsp.rpc.request()|, |vim.lsp.rpc.notify()|. For TCP + there is a builtin RPC client factory: + |vim.lsp.rpc.connect()| • cmd_cwd: (string, default=|getcwd()|) Directory to launch the `cmd` process. Not related to `root_dir`. • cmd_env: (table) Environment flags to pass to the LSP on @@ -1479,7 +1479,11 @@ save({lenses}, {bufnr}, {client_id}) *vim.lsp.codelens.save()* Lua module: vim.lsp.inlay_hint *lsp-inlay_hint* enable({bufnr}, {enable}) *vim.lsp.inlay_hint.enable()* - Enable/disable/toggle inlay hints for a buffer + Enables or disables inlay hints for a buffer. + + To "toggle", pass the inverse of `is_enabled()`: >lua + vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled()) +< Note: ~ This API is pre-release (unstable). diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index 03fe5c7b81..e80969c583 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -1048,7 +1048,7 @@ CTRL-I Go to [count] newer cursor position in jump list |tui-modifyOtherKeys| or |tui-csiu|, CTRL-I can be mapped separately from <Tab>, on the condition that both keys are mapped, otherwise the mapping applies to - both. + both. Except in tmux: https://github.com/tmux/tmux/issues/2705 *:ju* *:jumps* :ju[mps] Print the jump list (not a motion command). diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt index e6b5b06744..4312716b22 100644 --- a/runtime/doc/recover.txt +++ b/runtime/doc/recover.txt @@ -85,10 +85,10 @@ You can find this in the user manual, section |11.3|. *W325* The default |SwapExists| handler (|default-autocmds|) skips the |E325| prompt -(selects "(E)dit") if the swapfile owner process (1) is still running and (2) -was started by the current user. This presumes that you normally don't want -to be bothered with the |ATTENTION| message just because you happen to edit -the same file from multiple Nvim instances. In the worst case (a system +(and automatically chooses "(E)dit") if the swapfile owner process is still +running and owned by the current user. This presumes that you normally don't +want to be bothered with the |ATTENTION| message just because you happen to +edit the same file from multiple Nvim instances. In the worst case (a system crash) there will be more than one swapfile for the file; use |:recover| to inspect all of its swapfiles. diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index a02a93d559..f3448209ba 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -488,8 +488,7 @@ end --- See |vim.lsp.start_client()| for all available options. The most important are: --- --- - `name` arbitrary name for the LSP client. Should be unique per language server. ---- - `cmd` command (in list form) used to start the language server. Must be absolute, or found on ---- `$PATH`. Shell constructs like `~` are not expanded. +--- - `cmd` command string[] or function, described at |vim.lsp.start_client()|. --- - `root_dir` path to the project root. By default this is used to decide if an existing client --- should be re-used. The example above uses |vim.fs.find()| and |vim.fs.dirname()| to detect the --- root by traversing the file system upwards starting from the current directory until either @@ -666,13 +665,13 @@ end --- Field `cmd` in {config} is required. --- ---@param config (lsp.ClientConfig) Configuration for the server: ---- - cmd: (string[]|fun(dispatchers: table):table) command a list of ---- strings treated like |jobstart()|. The command must launch the language server ---- process. `cmd` can also be a function that creates an RPC client. ---- The function receives a dispatchers table and must return a table with the ---- functions `request`, `notify`, `is_closing` and `terminate` ---- See |vim.lsp.rpc.request()| and |vim.lsp.rpc.notify()| ---- For TCP there is a built-in rpc client factory: |vim.lsp.rpc.connect()| +--- - cmd: (string[]|fun(dispatchers: table):table) command string[] that launches the language +--- server (treated as in |jobstart()|, must be absolute or on `$PATH`, shell constructs like +--- "~" are not expanded), or function that creates an RPC client. Function receives +--- a `dispatchers` table and returns a table with member functions `request`, `notify`, +--- `is_closing` and `terminate`. +--- See |vim.lsp.rpc.request()|, |vim.lsp.rpc.notify()|. +--- For TCP there is a builtin RPC client factory: |vim.lsp.rpc.connect()| --- --- - cmd_cwd: (string, default=|getcwd()|) Directory to launch --- the `cmd` process. Not related to `root_dir`. diff --git a/runtime/lua/vim/lsp/inlay_hint.lua b/runtime/lua/vim/lsp/inlay_hint.lua index ce1680549e..4816b873ba 100644 --- a/runtime/lua/vim/lsp/inlay_hint.lua +++ b/runtime/lua/vim/lsp/inlay_hint.lua @@ -368,7 +368,13 @@ function M.is_enabled(bufnr) return bufstates[bufnr] and bufstates[bufnr].enabled or false end ---- Enable/disable/toggle inlay hints for a buffer +--- Enables or disables inlay hints for a buffer. +--- +--- To "toggle", pass the inverse of `is_enabled()`: +--- +--- ```lua +--- vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled()) +--- ``` --- --- @param bufnr (integer|nil) Buffer handle, or 0 or nil for current --- @param enable (boolean|nil) true/nil to enable, false to disable |