Skip to content

Commit d29b69c

Browse files
committed
Disable insert_import in extract_struct_from_enum_variant until its fixed
1 parent 7de2a30 commit d29b69c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/assists/src/handlers/extract_struct_from_enum_variant.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ fn insert_import(
118118
make::path_from_text(&mod_path.to_string()),
119119
Some(MergeBehaviour::Full),
120120
);
121+
// FIXME: this will currently panic as multiple imports will have overlapping text ranges
121122
builder.replace(syntax.text_range(), new_syntax.to_string())
122123
}
123124
Some(())
@@ -191,13 +192,15 @@ fn update_reference(
191192
list_range.end().checked_sub(TextSize::from(1))?,
192193
);
193194
builder.edit_file(reference.file_range.file_id);
195+
/* FIXME: this most likely requires AST-based editing, see `insert_import`
194196
if !visited_modules_set.contains(&module) {
195197
if insert_import(ctx, builder, &path_expr, &module, enum_module_def, variant_hir_name)
196198
.is_some()
197199
{
198200
visited_modules_set.insert(module);
199201
}
200202
}
203+
*/
201204
builder.replace(inside_list_range, format!("{}{}", segment, list));
202205
Some(())
203206
}
@@ -256,6 +259,7 @@ pub enum A { One(One) }"#,
256259
}
257260

258261
#[test]
262+
#[ignore] // FIXME: this currently panics if `insert_import` is used
259263
fn test_extract_struct_with_complex_imports() {
260264
check_assist(
261265
extract_struct_from_enum_variant,

0 commit comments

Comments
 (0)