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:
co-authored by
Thorsten
parent
4d26f83d23
commit
b9b62842f8
@@ -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()
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user