aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2025-03-08 09:30:36 +0000
committerLewis Russell <me@lewisr.dev>2025-03-10 18:54:03 +0000
commitdebabaf884fc26e9dc257aa5b62581d3846f80f1 (patch)
treef2c31107a9615fa4167a0d2b806dda847286ff6a /runtime/doc
parent3b0fe2659e74276e995655d1f8954b48005292e6 (diff)
downloadrneovim-debabaf884fc26e9dc257aa5b62581d3846f80f1.tar.gz
rneovim-debabaf884fc26e9dc257aa5b62581d3846f80f1.tar.bz2
rneovim-debabaf884fc26e9dc257aa5b62581d3846f80f1.zip
fix(lsp)!: pass buffer number to root_dir function
Problem: The root dir function is not passed any context and can only assume the current buffer is the one being attached. The main use case is for getting the path of the buffer using `nvim_buf_get_name`. Solution: Pass the buffer number as the first argument.
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/lsp.txt9
1 files changed, 5 insertions, 4 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 4c3fdcee6a..fd0df42fe4 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -678,10 +678,11 @@ Lua module: vim.lsp *lsp-core*
the LSP server will base its workspaceFolders,
rootUri, and rootPath on initialization. Unused if
`root_dir` is provided.
- • {root_dir}? (`string|fun(cb:fun(string))`) Directory where the
- LSP server will base its workspaceFolders, rootUri,
- and rootPath on initialization. If a function, it
- accepts a single callback argument which must be
+ • {root_dir}? (`string|fun(bufnr: integer, cb:fun(root_dir?:string))`)
+ Directory where the LSP server will base its
+ workspaceFolders, rootUri, and rootPath on
+ initialization. If a function, it is passed the
+ buffer number and a callback argument which must be
called with the value of root_dir to use. The LSP
server will not be started until the callback is
called.