diff options
author | Gregory Anders <greg@gpanders.com> | 2024-12-27 10:09:22 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-27 10:09:22 -0600 |
commit | 35247b00a44e838ed7d657a9b94964dc0664d28d (patch) | |
tree | d0c2911358fc4d0c8a905feb888465106fe7ce23 /runtime/doc | |
parent | 6d2c67350ad89abf09c5ddaaf02bcccfc5fc466c (diff) | |
download | rneovim-35247b00a44e838ed7d657a9b94964dc0664d28d.tar.gz rneovim-35247b00a44e838ed7d657a9b94964dc0664d28d.tar.bz2 rneovim-35247b00a44e838ed7d657a9b94964dc0664d28d.zip |
feat(lsp): support function for client root_dir (#31630)
If root_dir is a function it is evaluated when the client is created to
determine the root directory.
This enables dynamically determining the root directory based on e.g.
project or directory structure (example: finding a parent Cargo.toml
file that contains "[workspace]" in a Rust project).
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/lsp.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 8b822daf9e..16f543088b 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -683,6 +683,13 @@ 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 + called with the value of root_dir to use. The LSP + server will not be started until the callback is + called. • {reuse_client}? (`fun(client: vim.lsp.Client, config: vim.lsp.ClientConfig): boolean`) Predicate used to decide if a client should be re-used. Used on all running clients. The default |