Skip to content

Commit

Permalink
Warn about unavailable document instead of throwing error
Browse files Browse the repository at this point in the history
  • Loading branch information
snowsignal committed Jun 10, 2024
1 parent 134aa7c commit dae6768
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/ruff_server/src/server/api/requests/execute_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ impl super::SyncRequestHandler for ExecuteCommand {

let mut edit_tracker = WorkspaceEditTracker::new(session.resolved_client_capabilities());
for Argument { uri, version } in arguments {
let snapshot = session
.take_snapshot(uri.clone())
.ok_or(anyhow::anyhow!("Document snapshot not available for {uri}",))
.with_failure_code(ErrorCode::InternalError)?;
let Some(snapshot) = session.take_snapshot(uri.clone()) else {
tracing::warn!("Document at {uri} could not be opened");
return Ok(None);
};
match command {
Command::FixAll => {
let fixes = super::code_action_resolve::fix_all_edit(
Expand Down

0 comments on commit dae6768

Please sign in to comment.