mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-10 05:37:29 +03:00
For single-file worktrees start LSP with parent dir as CWD
This commit is contained in:
parent
44a68b723c
commit
9a6819b899
@ -109,8 +109,13 @@ impl LanguageServer {
|
|||||||
options: Option<Value>,
|
options: Option<Value>,
|
||||||
background: Arc<executor::Background>,
|
background: Arc<executor::Background>,
|
||||||
) -> Result<Self> {
|
) -> 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)
|
let mut server = Command::new(binary_path)
|
||||||
.current_dir(root_path)
|
.current_dir(working_dir)
|
||||||
.args(args)
|
.args(args)
|
||||||
.stdin(Stdio::piped())
|
.stdin(Stdio::piped())
|
||||||
.stdout(Stdio::piped())
|
.stdout(Stdio::piped())
|
||||||
|
Loading…
Reference in New Issue
Block a user