Skip to content

Commit 60d046f

Browse files
authored
Fix panic in handle_code_action
1 parent 40b2a68 commit 60d046f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/rust-analyzer/src/handlers/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ pub(crate) fn handle_code_action(
11561156
let code_action = to_proto::code_action(&snap, assist, resolve_data)?;
11571157

11581158
// Check if the client supports the necessary `ResourceOperation`s.
1159-
if let Some(changes) = &code_action.edit.as_ref().unwrap().document_changes {
1159+
if let Some(changes) = code_action.edit.as_ref().and_then(|it| &it.document_changes) {
11601160
for change in changes {
11611161
if let lsp_ext::SnippetDocumentChangeOperation::Op(res_op) = change {
11621162
if let Err(err) =

0 commit comments

Comments
 (0)