lsp: Treat unrooted paths as relative to the worktree root (#17769)
gopls would send us watch patterns like `**/*.mod` and we'd fall back to watching `/`. Release Notes: - Fix file watching for go projects resorting to watching the fs root. Co-authored-by: Thorsten <thorsten@zed.dev>
This commit is contained in:
parent
4d26f83d23
commit
b9b62842f8
1 changed files with 1 additions and 1 deletions
|
@ -3499,7 +3499,7 @@ impl LspStore {
|
||||||
.to_owned();
|
.to_owned();
|
||||||
let path = if Path::new(path).components().next().is_none()
|
let path = if Path::new(path).components().next().is_none()
|
||||||
{
|
{
|
||||||
Arc::from(Path::new("/"))
|
Arc::from(Path::new(worktree_root_path))
|
||||||
} else {
|
} else {
|
||||||
PathBuf::from(path).into()
|
PathBuf::from(path).into()
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue