diff --git a/crates/lsp/src/lsp.rs b/crates/lsp/src/lsp.rs index d9024975e4..a8b715f020 100644 --- a/crates/lsp/src/lsp.rs +++ b/crates/lsp/src/lsp.rs @@ -109,8 +109,13 @@ impl LanguageServer { options: Option, background: Arc, ) -> Result { + let working_dir = if root_path.is_dir() { + root_path + } else { + root_path.parent().unwrap_or(Path::new("/")) + }; let mut server = Command::new(binary_path) - .current_dir(root_path) + .current_dir(working_dir) .args(args) .stdin(Stdio::piped()) .stdout(Stdio::piped())