lsp: Watch paths outside of worktrees at language servers request (#17499)

Another stab at https://github.com/zed-industries/zed/pull/17173, this
time fixing the segfault found in
https://github.com/zed-industries/zed/pull/17206

Release Notes:

- Improved language server reliability in multi-worktree projects and
monorepo. We now notify the language server more reliably about which
files have changed.
This commit is contained in:
Piotr Osiewicz 2024-09-06 15:47:17 +02:00 committed by GitHub
parent 938c90fd3b
commit 903f92045a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 446 additions and 102 deletions

View file

@ -369,9 +369,9 @@ impl ExtensionStore {
let installed_dir = this.installed_dir.clone();
async move {
let (mut paths, _) = fs.watch(&installed_dir, FS_WATCH_LATENCY).await;
while let Some(paths) = paths.next().await {
for path in paths {
let Ok(event_path) = path.strip_prefix(&installed_dir) else {
while let Some(events) = paths.next().await {
for event in events {
let Ok(event_path) = event.path.strip_prefix(&installed_dir) else {
continue;
};