Skip to content

Commit

Permalink
Be extra defensive against non-air.tomls
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisVaughan committed Dec 18, 2024
1 parent 81f9f24 commit 491bb6a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/lsp/src/workspaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl WorkspaceSettingsResolver {
let path = match Self::url_to_path(url) {
Ok(Some(path)) => path,
Ok(None) => {
tracing::warn!("Ignoring non-file workspace URL: {url}");
tracing::trace!("Ignoring non-`file` changed URL: {url}");
return;
}
Err(error) => {
Expand All @@ -125,6 +125,13 @@ impl WorkspaceSettingsResolver {
}
};

if !path.ends_with("air.toml") {
// We could get called with a changed file that isn't an `air.toml` if we are
// watching more than `air.toml` files
tracing::trace!("Ignoring non-`air.toml` changed URL: {url}");
return;
}

for (workspace_path, settings_resolver) in self.path_to_settings_resolver.matches_mut(&path)
{
tracing::trace!("Reloading workspace settings: {}", workspace_path.display());
Expand Down

0 comments on commit 491bb6a

Please sign in to comment.