aboutsummaryrefslogtreecommitdiff
path: root/crates/assists/src/handlers/extract_struct_from_enum_variant.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-11-28 14:33:57 +0000
committerGitHub <[email protected]>2020-11-28 14:33:57 +0000
commitb7ece77af49ce59762fc3246a4c721411efe637e (patch)
tree81c617c2df781e27b0c16c10515ebcf588cb376e /crates/assists/src/handlers/extract_struct_from_enum_variant.rs
parentfe2ac4480bd71c9cf25d2c21bda82b33558d27a4 (diff)
parent3f612d37c68a6e4c09e407b7cd2ad8a1d17ab4e6 (diff)
Merge #6650
6650: Make completion and assists module independent r=matklad a=SomeoneToIgnore A follow-up of https://github.com/rust-analyzer/rust-analyzer/pull/6553#discussion_r524402907 Move the common code for both assists and completion modules into a separate crate. Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'crates/assists/src/handlers/extract_struct_from_enum_variant.rs')
-rw-r--r--crates/assists/src/handlers/extract_struct_from_enum_variant.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs
index cac77c49b..d85767b4e 100644
--- a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs
+++ b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs
@@ -2,6 +2,10 @@ use std::iter;
2 2
3use either::Either; 3use either::Either;
4use hir::{AsName, EnumVariant, Module, ModuleDef, Name}; 4use hir::{AsName, EnumVariant, Module, ModuleDef, Name};
5use ide_db::helpers::{
6 insert_use::{insert_use, ImportScope},
7 mod_path_to_ast,
8};
5use ide_db::{defs::Definition, search::Reference, RootDatabase}; 9use ide_db::{defs::Definition, search::Reference, RootDatabase};
6use rustc_hash::{FxHashMap, FxHashSet}; 10use rustc_hash::{FxHashMap, FxHashSet};
7use syntax::{ 11use syntax::{
@@ -10,10 +14,7 @@ use syntax::{
10 SourceFile, SyntaxElement, SyntaxNode, T, 14 SourceFile, SyntaxElement, SyntaxNode, T,
11}; 15};
12 16
13use crate::{ 17use crate::{AssistContext, AssistId, AssistKind, Assists};
14 utils::{insert_use, mod_path_to_ast, ImportScope},
15 AssistContext, AssistId, AssistKind, Assists,
16};
17 18
18// Assist: extract_struct_from_enum_variant 19// Assist: extract_struct_from_enum_variant
19// 20//
@@ -236,10 +237,9 @@ fn update_reference(
236 237
237#[cfg(test)] 238#[cfg(test)]
238mod tests { 239mod tests {
239 use crate::{ 240 use ide_db::helpers::FamousDefs;
240 tests::{check_assist, check_assist_not_applicable}, 241
241 utils::FamousDefs, 242 use crate::tests::{check_assist, check_assist_not_applicable};
242 };
243 243
244 use super::*; 244 use super::*;
245 245