autoload/lsp/lspserver.vim | 4 ++-- doc/lsp.txt | 3 +-- diff --git a/autoload/lsp/lspserver.vim b/autoload/lsp/lspserver.vim index 89822e48cb59108ed34d9d108944cfd8e505432f..2d71cd9a0479c7d04ce7141dedd776b499f85e40 100644 --- a/autoload/lsp/lspserver.vim +++ b/autoload/lsp/lspserver.vim @@ -153,14 +153,14 @@ version: v:versionlong->string(), } # 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 8f40636d3f93f7b72e97acc913ac1800d6b52391..6ea8a030e78675cd64120a333672c528ab63eb06 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -271,8 +271,7 @@ multiple directories are found, then the directory 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: