From 56a4ef3c213d87bfba5f361376bd23eefdf6c6ec Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 11 Jul 2025 08:33:29 -0400 Subject: docs: lsp, ui events, dev guidance, osc7 fix #34981 --- runtime/lua/vim/_core/server.lua | 15 +++++++------- runtime/lua/vim/_meta/api.lua | 4 ++++ runtime/lua/vim/_meta/options.lua | 5 +++-- runtime/lua/vim/_meta/vimfn.lua | 40 ++++++++++++++++++------------------ runtime/lua/vim/_system.lua | 4 ++++ runtime/lua/vim/net.lua | 16 +++++---------- runtime/lua/vim/shared.lua | 2 +- runtime/lua/vim/treesitter/query.lua | 5 ++--- 8 files changed, 47 insertions(+), 44 deletions(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/_core/server.lua b/runtime/lua/vim/_core/server.lua index 281a5705ea..367dfe2ff3 100644 --- a/runtime/lua/vim/_core/server.lua +++ b/runtime/lua/vim/_core/server.lua @@ -1,17 +1,18 @@ local M = {} ---- Called by builtin serverlist(). Returns all running servers. ---- in stdpath("run"). Does not include named pipes or TCP servers. +--- Called by builtin serverlist(). Returns all running servers in stdpath("run"). +--- +--- - TODO: track TCP servers, somehow. +--- - TODO: support Windows named pipes. --- --- @param listed string[] Already listed servers ---- @return string[] A list of currently running servers in stdpath("run") +--- @return string[] # List of servers found on the current machine in stdpath("run"). function M.serverlist(listed) - -- TODO: also get named pipes on Windows local socket_paths = vim.fs.find(function(name, _) return name:match('nvim.*') end, { path = vim.fn.stdpath('run'), type = 'socket', limit = math.huge }) - local running_sockets = {} + local found = {} ---@type string[] for _, socket in ipairs(socket_paths) do -- Don't list servers twice if not vim.list_contains(listed, socket) then @@ -20,14 +21,14 @@ function M.serverlist(listed) -- Check that the server is responding -- TODO: do we need a timeout or error handling here? if vim.fn.rpcrequest(chan, 'nvim_get_chan_info', 0).id then - table.insert(running_sockets, socket) + table.insert(found, socket) end vim.fn.chanclose(chan) end end end - return running_sockets + return found end return M diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index 3177244e1a..26b51b7dbb 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -2045,6 +2045,10 @@ function vim.api.nvim_put(lines, type, after, follow) end --- Replaces terminal codes and `keycodes` ([], [], ...) in a string with --- the internal representation. --- +--- +--- Note: +--- Lua can use |vim.keycode()| instead. +--- --- @see replace_termcodes --- @see cpoptions --- @param str string String to be converted. diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 354e223cc8..ee87ebc322 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -2239,7 +2239,8 @@ vim.bo.et = vim.bo.expandtab --- Unset 'exrc' to stop further searching of 'exrc' files in parent --- directories, similar to `editorconfig.root`. --- ---- To get its own location, Lua exrc files can use `debug.getinfo()`. +--- To get its own location, a Lua exrc file can use `debug.getinfo()`. +--- See `lua-script-location`. --- --- Compare 'exrc' to `editorconfig`: --- - 'exrc' can execute any code; editorconfig only specifies settings. @@ -2251,7 +2252,7 @@ vim.bo.et = vim.bo.expandtab --- 3. Create ".nvim.lua" in your project root directory with this line: --- --- ```lua ---- vim.cmd[[set runtimepath+=.nvim]] +--- vim.cmd[[set runtimepath+=.nvim]] --- ``` --- --- This option cannot be set from a `modeline` or in the `sandbox`, for diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 1674a52289..0c6d806a36 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -1855,35 +1855,35 @@ function vim.fn.exp(expr) end --- done like for the |cmdline-special| variables with their --- associated modifiers. Here is a short overview: --- ---- % current file name ---- # alternate file name ---- #n alternate file name n ---- file name under the cursor ---- autocmd file name ---- autocmd buffer number (as a String!) ---- autocmd matched name +--- % Current file name +--- # Alternate file name +--- #n Alternate file name n +--- File name under the cursor +--- Autocmd file name +--- Autocmd buffer number (as a String!) +--- Autocmd matched name --- C expression under the cursor ---- deprecated, use