diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-04 21:09:32 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-04 21:09:32 +0100 |
commit | cacdb0eab8131bfb945eb7ed0150c92ec56eefe2 (patch) | |
tree | f762de90ce813591bc640ae0bce36493a3dcafa9 /crates/ra_assists/src/introduce_variable.rs | |
parent | 4e8664d9d37021e85d72b6228fa45e7edf4a1a74 (diff) | |
parent | 1834bae5b86c54ed9dece26e82436919d59e6cb7 (diff) |
Merge #1486
1486: allow rustfmt to reorder imports r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/introduce_variable.rs')
-rw-r--r-- | crates/ra_assists/src/introduce_variable.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/crates/ra_assists/src/introduce_variable.rs b/crates/ra_assists/src/introduce_variable.rs index 28467d341..f7f5ccafa 100644 --- a/crates/ra_assists/src/introduce_variable.rs +++ b/crates/ra_assists/src/introduce_variable.rs | |||
@@ -1,12 +1,14 @@ | |||
1 | use test_utils::tested_by; | ||
2 | use hir::db::HirDatabase; | 1 | use hir::db::HirDatabase; |
3 | use ra_syntax::{ | 2 | use ra_syntax::{ |
4 | ast::{self, AstNode}, | 3 | ast::{self, AstNode}, |
4 | SyntaxKind::{ | ||
5 | BREAK_EXPR, COMMENT, LAMBDA_EXPR, LOOP_EXPR, MATCH_ARM, PATH_EXPR, RETURN_EXPR, WHITESPACE, | ||
6 | }, | ||
5 | SyntaxNode, TextUnit, | 7 | SyntaxNode, TextUnit, |
6 | SyntaxKind::{WHITESPACE, MATCH_ARM, LAMBDA_EXPR, PATH_EXPR, BREAK_EXPR, LOOP_EXPR, RETURN_EXPR, COMMENT}, | ||
7 | }; | 8 | }; |
9 | use test_utils::tested_by; | ||
8 | 10 | ||
9 | use crate::{AssistCtx, Assist, AssistId}; | 11 | use crate::{Assist, AssistCtx, AssistId}; |
10 | 12 | ||
11 | pub(crate) fn introduce_variable(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { | 13 | pub(crate) fn introduce_variable(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { |
12 | if ctx.frange.range.is_empty() { | 14 | if ctx.frange.range.is_empty() { |
@@ -121,7 +123,9 @@ fn anchor_stmt(expr: &ast::Expr) -> Option<(&SyntaxNode, bool)> { | |||
121 | mod tests { | 123 | mod tests { |
122 | use test_utils::covers; | 124 | use test_utils::covers; |
123 | 125 | ||
124 | use crate::helpers::{check_assist_range_not_applicable, check_assist_range, check_assist_range_target}; | 126 | use crate::helpers::{ |
127 | check_assist_range, check_assist_range_not_applicable, check_assist_range_target, | ||
128 | }; | ||
125 | 129 | ||
126 | use super::*; | 130 | use super::*; |
127 | 131 | ||