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>,
|
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…
Add table
Add a link
Reference in a new issue