Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/handlers/add_missing_match_arms.rs')
-rw-r--r--crates/ide-assists/src/handlers/add_missing_match_arms.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/ide-assists/src/handlers/add_missing_match_arms.rs b/crates/ide-assists/src/handlers/add_missing_match_arms.rs
index 37f5f44dfa..fee7662a78 100644
--- a/crates/ide-assists/src/handlers/add_missing_match_arms.rs
+++ b/crates/ide-assists/src/handlers/add_missing_match_arms.rs
@@ -2,6 +2,7 @@ use std::iter::{self, Peekable};
use either::Either;
use hir::{sym, Adt, Crate, HasAttrs, ImportPathConfig, ModuleDef, Semantics};
+use ide_db::base_db::salsa::AsDynDatabase;
use ide_db::syntax_helpers::suggest_name;
use ide_db::RootDatabase;
use ide_db::{famous_defs::FamousDefs, helpers::mod_path_to_ast};
@@ -256,7 +257,12 @@ pub(crate) fn add_missing_match_arms(acc: &mut Assists, ctx: &AssistContext<'_>)
// Just replace the element that the original range came from
let old_place = {
// Find the original element
- let file = ctx.sema.parse(arm_list_range.file_id);
+ let editioned_file_id = ide_db::base_db::EditionedFileId::new(
+ ctx.sema.db.as_dyn_database(),
+ arm_list_range.file_id,
+ );
+
+ let file = ctx.sema.parse(editioned_file_id);
let old_place = file.syntax().covering_element(arm_list_range.range);
match old_place {