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:
Piotr Osiewicz
2024-09-12 15:23:27 -04:00
committed by GitHub
co-authored by Thorsten
parent 4d26f83d23
commit b9b62842f8
+1 -1
View File
@@ -3499,7 +3499,7 @@ impl LspStore {
.to_owned();
let path = if Path::new(path).components().next().is_none()
{
Arc::from(Path::new("/"))
Arc::from(Path::new(worktree_root_path))
} else {
PathBuf::from(path).into()
};