diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2023-06-30 08:38:44 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-30 08:38:44 +0200 |
| commit | 60d046f567239b102d064ae7391bcf8aa78784d1 (patch) | |
| tree | cd671940f5cdc74463194adf4a0857feb0aafc76 | |
| parent | 40b2a68381f6889416a7b6aebc14a98902429a09 (diff) | |
| download | rust-60d046f567239b102d064ae7391bcf8aa78784d1.tar.gz rust-60d046f567239b102d064ae7391bcf8aa78784d1.zip | |
Fix panic in `handle_code_action`
| -rw-r--r-- | crates/rust-analyzer/src/handlers/request.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/handlers/request.rs b/crates/rust-analyzer/src/handlers/request.rs index 569cd632c60..6f53d5f5fc2 100644 --- a/crates/rust-analyzer/src/handlers/request.rs +++ b/crates/rust-analyzer/src/handlers/request.rs @@ -1156,7 +1156,7 @@ pub(crate) fn handle_code_action( let code_action = to_proto::code_action(&snap, assist, resolve_data)?; // Check if the client supports the necessary `ResourceOperation`s. - if let Some(changes) = &code_action.edit.as_ref().unwrap().document_changes { + if let Some(changes) = code_action.edit.as_ref().and_then(|it| &it.document_changes) { for change in changes { if let lsp_ext::SnippetDocumentChangeOperation::Op(res_op) = change { if let Err(err) = |
