Fix panic in handle_code_action

This commit is contained in:
Lukas Wirth 2023-06-30 08:42:46 +02:00 committed by GitHub
parent 60d046f567
commit 7e7f401a81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1156,7 +1156,8 @@ 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().and_then(|it| &it.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 {
if let lsp_ext::SnippetDocumentChangeOperation::Op(res_op) = change {
if let Err(err) =