Auto merge of #15177 - rust-lang:Veykril-patch-1, r=Veykril

Fix panic in `handle_code_action`

🤞 that CI is happy with this, edited this via github
This commit is contained in:
bors 2023-06-30 06:56:21 +00:00
commit f96442aa90

View file

@ -1156,7 +1156,8 @@ pub(crate) fn handle_code_action(
let code_action = to_proto::code_action(&snap, assist, resolve_data)?; let code_action = to_proto::code_action(&snap, assist, resolve_data)?;
// Check if the client supports the necessary `ResourceOperation`s. // Check if the client supports the necessary `ResourceOperation`s.
if let Some(changes) = &code_action.edit.as_ref().unwrap().document_changes { let changes = code_action.edit.as_ref().and_then(|it| it.document_changes.as_ref());
if let Some(changes) = changes {
for change in changes { for change in changes {
if let lsp_ext::SnippetDocumentChangeOperation::Op(res_op) = change { if let lsp_ext::SnippetDocumentChangeOperation::Op(res_op) = change {
if let Err(err) = if let Err(err) =