mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-24 15:42:53 +00:00
For single-file worktrees start LSP with parent dir as CWD
This commit is contained in:
parent
44a68b723c
commit
9a6819b899
1 changed files with 6 additions and 1 deletions
|
@ -109,8 +109,13 @@ impl LanguageServer {
|
|||
options: Option<Value>,
|
||||
background: Arc<executor::Background>,
|
||||
) -> Result<Self> {
|
||||
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())
|
||||
|
|
Loading…
Reference in a new issue