diff options
author | Dmitry <[email protected]> | 2020-08-09 17:47:02 +0100 |
---|---|---|
committer | Dmitry <[email protected]> | 2020-08-09 17:47:02 +0100 |
commit | cff0fba5e5fb4a5de470bf923b93b0bdd89d9efb (patch) | |
tree | 6203f06dd105aa0d3a70282e9f3f4978d48bcc38 /crates | |
parent | 7f71ae8d73ea2a2203897703324e11c2096706fa (diff) |
apply format
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_ide/src/completion.rs | 3 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/complete_attribute.rs | 11 |
2 files changed, 9 insertions, 5 deletions
diff --git a/crates/ra_ide/src/completion.rs b/crates/ra_ide/src/completion.rs index 7b96902fb..a537b68b1 100644 --- a/crates/ra_ide/src/completion.rs +++ b/crates/ra_ide/src/completion.rs | |||
@@ -21,12 +21,13 @@ mod complete_trait_impl; | |||
21 | mod unstable_feature_descriptor; | 21 | mod unstable_feature_descriptor; |
22 | use ra_ide_db::RootDatabase; | 22 | use ra_ide_db::RootDatabase; |
23 | 23 | ||
24 | #[rustfmt::skip] | ||
24 | use crate::{ | 25 | use crate::{ |
25 | completion::{ | 26 | completion::{ |
26 | completion_context::CompletionContext, | 27 | completion_context::CompletionContext, |
27 | completion_item::{CompletionKind, Completions}, | 28 | completion_item::{CompletionKind, Completions}, |
28 | 29 | ||
29 | //TODO: rework | 30 | //TODO: cyclic imports caused by xtask generation, this should be better |
30 | unstable_feature_descriptor::UNSTABLE_FEATURE_DESCRIPTOR, | 31 | unstable_feature_descriptor::UNSTABLE_FEATURE_DESCRIPTOR, |
31 | complete_attribute::LintCompletion, | 32 | complete_attribute::LintCompletion, |
32 | }, | 33 | }, |
diff --git a/crates/ra_ide/src/completion/complete_attribute.rs b/crates/ra_ide/src/completion/complete_attribute.rs index 50b0b3ff6..2161cdfd2 100644 --- a/crates/ra_ide/src/completion/complete_attribute.rs +++ b/crates/ra_ide/src/completion/complete_attribute.rs | |||
@@ -19,9 +19,7 @@ pub(super) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext) | |||
19 | (Some(path), Some(token_tree)) if path.to_string() == "derive" => { | 19 | (Some(path), Some(token_tree)) if path.to_string() == "derive" => { |
20 | complete_derive(acc, ctx, token_tree) | 20 | complete_derive(acc, ctx, token_tree) |
21 | } | 21 | } |
22 | (Some(path), Some(token_tree)) | 22 | (Some(path), Some(token_tree)) if path.to_string() == "feature" => { |
23 | if path.to_string() == "feature" => | ||
24 | { | ||
25 | complete_lint(acc, ctx, token_tree, UNSTABLE_FEATURE_DESCRIPTOR); | 23 | complete_lint(acc, ctx, token_tree, UNSTABLE_FEATURE_DESCRIPTOR); |
26 | } | 24 | } |
27 | (Some(path), Some(token_tree)) | 25 | (Some(path), Some(token_tree)) |
@@ -169,7 +167,12 @@ fn complete_derive(acc: &mut Completions, ctx: &CompletionContext, derive_input: | |||
169 | } | 167 | } |
170 | } | 168 | } |
171 | 169 | ||
172 | fn complete_lint(acc: &mut Completions, ctx: &CompletionContext, derive_input: ast::TokenTree, lints_completions: &[LintCompletion]) { | 170 | fn complete_lint( |
171 | acc: &mut Completions, | ||
172 | ctx: &CompletionContext, | ||
173 | derive_input: ast::TokenTree, | ||
174 | lints_completions: &[LintCompletion], | ||
175 | ) { | ||
173 | if let Ok(existing_lints) = parse_comma_sep_input(derive_input) { | 176 | if let Ok(existing_lints) = parse_comma_sep_input(derive_input) { |
174 | for lint_completion in lints_completions | 177 | for lint_completion in lints_completions |
175 | .into_iter() | 178 | .into_iter() |