aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2026-10-09 07:41:57 -0400
committerGitHub <noreply@github.com>2026-10-09 07:41:57 -0400
commitf5e839bdec08be149c36674483c98a77ce956dc8 (patch)
tree60e1ee70d181a7a34bcf6fe54705500fa858159f /runtime/lua/vim
parent402a494f47808442f3de9266b147b274f8c7a5be (diff)
parente86770511644a2216f8080652996d7a6c2f2eefd (diff)
downloadrneovim-f5e839bdec08be149c36674483c98a77ce956dc8.tar.gz
rneovim-f5e839bdec08be149c36674483c98a77ce956dc8.tar.bz2
rneovim-f5e839bdec08be149c36674483c98a77ce956dc8.zip
Merge #42288 from justinmk/fixmisc2
feat(api): nvim_chan_set()
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/_core/editor.lua5
-rw-r--r--runtime/lua/vim/_core/shared.lua4
-rw-r--r--runtime/lua/vim/_meta/api.gen.lua37
-rw-r--r--runtime/lua/vim/_meta/api_keysets.gen.lua3
-rw-r--r--runtime/lua/vim/lsp.lua6
5 files changed, 34 insertions, 21 deletions
diff --git a/runtime/lua/vim/_core/editor.lua b/runtime/lua/vim/_core/editor.lua
index 215b47b9b8..a3490c8cb6 100644
--- a/runtime/lua/vim/_core/editor.lua
+++ b/runtime/lua/vim/_core/editor.lua
@@ -44,8 +44,7 @@ vim._extra = {
--- Waits up to `time` milliseconds, until `callback` returns `true` (success). Executes
--- `callback` immediately, then on user events, internal events, and approximately every
---- `interval` milliseconds (default 200). Returns `true` plus any remaining callback
---- results on success.
+--- `interval` milliseconds. Returns `true` plus any remaining callback results on success.
---
--- Nvim processes other events while waiting.
--- Cannot be called during an |api-fast| event.
@@ -84,7 +83,7 @@ vim._extra = {
--- @param time number Number of milliseconds to wait. Must be non-negative number, any fractional
--- part is truncated.
--- @param callback? fun(): boolean, ... Optional callback. Waits until {callback} returns true
---- @param interval? integer (Approximate) number of milliseconds to wait between polls
+--- @param interval? integer (default: 200) Milliseconds (approximate) to wait between polls.
--- @param fast_only? boolean If true, only |api-fast| events will be processed.
--- @return boolean, nil|-1|-2, ...
--- - If callback returns `true` before timeout: `true, ...` (remaining callback results).
diff --git a/runtime/lua/vim/_core/shared.lua b/runtime/lua/vim/_core/shared.lua
index f0a88dcc40..f3c7a37d60 100644
--- a/runtime/lua/vim/_core/shared.lua
+++ b/runtime/lua/vim/_core/shared.lua
@@ -818,8 +818,8 @@ end
---@generic T: table
---@param dst T List which will be modified and appended to
---@param src table List from which values will be inserted
----@param start integer? Start index on src. Defaults to 1
----@param finish integer? Final index on src. Defaults to `#src`
+---@param start integer? (default: 1) Start index on src.
+---@param finish integer? (default: `#src`) Final index on src.
---@return T dst
function vim.list_extend(dst, src, start, finish)
vim.validate('dst', dst, 'table')
diff --git a/runtime/lua/vim/_meta/api.gen.lua b/runtime/lua/vim/_meta/api.gen.lua
index 72155d78d3..a78b55719a 100644
--- a/runtime/lua/vim/_meta/api.gen.lua
+++ b/runtime/lua/vim/_meta/api.gen.lua
@@ -850,6 +850,14 @@ function vim.api.nvim_call_function(fn, args) end
--- @param data string Data to write. 8-bit clean: may contain NUL bytes.
function vim.api.nvim_chan_send(chan, data) end
+--- Sets channel properties.
+---
+--- @param chan integer Channel id, or 0 for current (RPC) channel.
+--- @param config vim.api.keyset.chan_set Properties:
+--- - detach: (boolean, default: true) Closing the channel does not self-exit Nvim. Nvim
+--- self-exits when the last `detach=false` `RPC` channel closes. See also `:detach!`.
+function vim.api.nvim_chan_set(chan, config) end
+
--- Clears all autocommands matching the {opts} query. To delete autocmds see `nvim_del_autocmd()`.
---
--- @param opts vim.api.keyset.clear_autocmds? Optional parameters:
@@ -1302,17 +1310,19 @@ function vim.api.nvim_get_autocmds(opts) end
--- Gets information about a channel.
---
---- See `nvim_list_uis()` for an example of how to get channel info.
+--- The docs for `nvim_list_uis()` show an example.
---
---- @param chan integer channel_id, or 0 for current channel
+--- @param chan integer Channel id, or 0 for current (RPC) channel
--- @return table<string,any> # Channel info dict with these keys:
---- - "id" Channel id.
--- - "argv" (optional) Job arguments list.
---- - "stream" Stream underlying the channel.
---- - "stdio" stdin and stdout of this Nvim instance
---- - "stderr" stderr of this Nvim instance
---- - "socket" TCP/IP socket or named pipe
---- - "job" Job with communication over its stdio.
+--- - "buf" (optional) Buffer connected to |terminal| instance.
+--- - "buffer" (optional) Deprecated alias for `buf`.
+--- - "client" (optional) Info about the peer (client on the other end of the channel), as set
+--- by |nvim_set_client_info()|.
+--- - "detach" (optional) Closing the |RPC| channel does not exit Nvim. |nvim_chan_set()|
+--- - "exitcode" (optional) Exit code of the |terminal| process.
+--- - "id" Channel id.
+--- - "internal" (optional) In-process channel (stream=socket).
--- - "mode" How data received on the channel is interpreted.
--- - "bytes" Send and receive raw bytes.
--- - "terminal" |terminal| instance interprets ASCII sequences.
@@ -1320,12 +1330,11 @@ function vim.api.nvim_get_autocmds(opts) end
--- - "pty" (optional) Name of pseudoterminal. On a POSIX system this is a device path like
--- "/dev/pts/1". If unknown, the key will still be present if a pty is used (e.g.
--- for conpty on Windows).
---- - "buf" (optional) Buffer connected to |terminal| instance.
---- - "buffer" (optional) Deprecated alias for `buf`.
---- - "client" (optional) Info about the peer (client on the other end of the channel), as set
---- by |nvim_set_client_info()|.
---- - "exitcode" (optional) Exit code of the |terminal| process.
----
+--- - "stream" Stream underlying the channel.
+--- - "stdio" stdin and stdout of this Nvim instance
+--- - "stderr" stderr of this Nvim instance
+--- - "socket" TCP/IP socket or named pipe
+--- - "job" Job with communication over its stdio.
function vim.api.nvim_get_chan_info(chan) end
--- Returns the 24-bit RGB value of a `nvim_get_color_map()` color name or
diff --git a/runtime/lua/vim/_meta/api_keysets.gen.lua b/runtime/lua/vim/_meta/api_keysets.gen.lua
index a0411448eb..f3cbd54a2d 100644
--- a/runtime/lua/vim/_meta/api_keysets.gen.lua
+++ b/runtime/lua/vim/_meta/api_keysets.gen.lua
@@ -17,6 +17,9 @@ error('Cannot require a meta file')
--- @field force? boolean
--- @field unload? boolean
+--- @class vim.api.keyset.chan_set
+--- @field detach? boolean
+
--- @class vim.api.keyset.clear_autocmds
--- @field buf? integer
--- @field buffer? integer
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua
index 6122e72ea0..f4aa96218a 100644
--- a/runtime/lua/vim/lsp.lua
+++ b/runtime/lua/vim/lsp.lua
@@ -689,11 +689,13 @@ end
--- Buffer handle to attach to if starting or re-using a client (0 for current).
--- @field bufnr? integer
---
---- Whether to attach the client to a buffer (default true).
+--- Whether to attach the client to a buffer.
--- If set to `false`, `reuse_client` and `bufnr` will be ignored.
+--- (default: true)
--- @field attach? boolean
---
---- Suppress error reporting if the LSP server fails to start (default false).
+--- Suppress error reporting if the LSP server fails to start.
+--- (default: false)
--- @field silent? boolean
---
--- @field package _root_markers? (string|string[])[]