Use proper assertion in on-type formatting edits

Co-authored-by: DropDemBits <r3usrlnd@gmail.com>
This commit is contained in:
Kirill Bulatov 2023-08-31 10:15:31 +03:00
parent 0f1cde709a
commit da786170f8

View File

@ -354,7 +354,7 @@ pub(crate) fn handle_on_type_formatting(
// This should be a single-file edit // This should be a single-file edit
let (_, (text_edit, snippet_edit)) = edit.source_file_edits.into_iter().next().unwrap(); let (_, (text_edit, snippet_edit)) = edit.source_file_edits.into_iter().next().unwrap();
stdx::never!(snippet_edit.is_none(), "on type formatting shouldn't use structured snippets"); stdx::always!(snippet_edit.is_none(), "on type formatting shouldn't use structured snippets");
let change = to_proto::snippet_text_edit_vec(&line_index, edit.is_snippet, text_edit); let change = to_proto::snippet_text_edit_vec(&line_index, edit.is_snippet, text_edit);
Ok(Some(change)) Ok(Some(change))