From: Andreas Louv Date: Fri, 7 Apr 2023 22:11:29 +0000 (+0200) Subject: Use the CWD as the "rootUri" and initial "workspaceFolder" X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=9c9e1d32f7dde654c87e2c4b291ca274597b99a5;p=vim-lsp.git Use the CWD as the "rootUri" and initial "workspaceFolder" --- diff --git a/autoload/lsp/lspserver.vim b/autoload/lsp/lspserver.vim index 89822e4..2d71cd9 100644 --- a/autoload/lsp/lspserver.vim +++ b/autoload/lsp/lspserver.vim @@ -153,14 +153,14 @@ def InitServer(lspserver: dict, bnr: number) } # Compute the rootpath (based on the directory of the buffer) - var bufDir = bnr->bufname()->fnamemodify(':p:h') var rootPath = '' var rootSearchFiles = lspserver.rootSearchFiles if !rootSearchFiles->empty() + var bufDir = bnr->bufname()->fnamemodify(':p:h') rootPath = util.FindNearestRootDir(bufDir, rootSearchFiles) endif if rootPath == '' - rootPath = bufDir + rootPath = getcwd() endif lspserver.workspaceFolders = [rootPath] diff --git a/doc/lsp.txt b/doc/lsp.txt index 8f40636..6ea8a03 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -271,8 +271,7 @@ To add a language server, the following information is needed: closest to the directory of the current buffer is used as the workspace root. If this parameter is not specified or the files are not found, then the - directory of the current buffer is used as the - workspace root. + current working directory is used as the workspace root. Aditionally the following configurations can be made: