diff options
Diffstat (limited to 'crates/completion/src/lib.rs')
-rw-r--r-- | crates/completion/src/lib.rs | 62 |
1 files changed, 23 insertions, 39 deletions
diff --git a/crates/completion/src/lib.rs b/crates/completion/src/lib.rs index b72fd249d..89c0a9978 100644 --- a/crates/completion/src/lib.rs +++ b/crates/completion/src/lib.rs | |||
@@ -1,39 +1,23 @@ | |||
1 | //! `completions` crate provides utilities for generating completions of user input. | 1 | //! `completions` crate provides utilities for generating completions of user input. |
2 | 2 | ||
3 | mod completion_config; | 3 | mod config; |
4 | mod completion_item; | 4 | mod item; |
5 | mod completion_context; | 5 | mod context; |
6 | mod presentation; | ||
7 | mod patterns; | 6 | mod patterns; |
8 | mod generated_lint_completions; | 7 | mod generated_lint_completions; |
9 | #[cfg(test)] | 8 | #[cfg(test)] |
10 | mod test_utils; | 9 | mod test_utils; |
11 | 10 | ||
12 | mod complete_attribute; | 11 | mod completions; |
13 | mod complete_dot; | ||
14 | mod complete_record; | ||
15 | mod complete_pattern; | ||
16 | mod complete_fn_param; | ||
17 | mod complete_keyword; | ||
18 | mod complete_snippet; | ||
19 | mod complete_qualified_path; | ||
20 | mod complete_unqualified_path; | ||
21 | mod complete_postfix; | ||
22 | mod complete_macro_in_item_position; | ||
23 | mod complete_trait_impl; | ||
24 | mod complete_mod; | ||
25 | 12 | ||
26 | use ide_db::base_db::FilePosition; | 13 | use ide_db::base_db::FilePosition; |
27 | use ide_db::RootDatabase; | 14 | use ide_db::RootDatabase; |
28 | 15 | ||
29 | use crate::{ | 16 | use crate::{completions::Completions, context::CompletionContext, item::CompletionKind}; |
30 | completion_context::CompletionContext, | ||
31 | completion_item::{CompletionKind, Completions}, | ||
32 | }; | ||
33 | 17 | ||
34 | pub use crate::{ | 18 | pub use crate::{ |
35 | completion_config::CompletionConfig, | 19 | config::CompletionConfig, |
36 | completion_item::{CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat}, | 20 | item::{CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat}, |
37 | }; | 21 | }; |
38 | 22 | ||
39 | //FIXME: split the following feature into fine-grained features. | 23 | //FIXME: split the following feature into fine-grained features. |
@@ -118,28 +102,28 @@ pub fn completions( | |||
118 | } | 102 | } |
119 | 103 | ||
120 | let mut acc = Completions::default(); | 104 | let mut acc = Completions::default(); |
121 | complete_attribute::complete_attribute(&mut acc, &ctx); | 105 | completions::attribute::complete_attribute(&mut acc, &ctx); |
122 | complete_fn_param::complete_fn_param(&mut acc, &ctx); | 106 | completions::fn_param::complete_fn_param(&mut acc, &ctx); |
123 | complete_keyword::complete_expr_keyword(&mut acc, &ctx); | 107 | completions::keyword::complete_expr_keyword(&mut acc, &ctx); |
124 | complete_keyword::complete_use_tree_keyword(&mut acc, &ctx); | 108 | completions::keyword::complete_use_tree_keyword(&mut acc, &ctx); |
125 | complete_snippet::complete_expr_snippet(&mut acc, &ctx); | 109 | completions::snippet::complete_expr_snippet(&mut acc, &ctx); |
126 | complete_snippet::complete_item_snippet(&mut acc, &ctx); | 110 | completions::snippet::complete_item_snippet(&mut acc, &ctx); |
127 | complete_qualified_path::complete_qualified_path(&mut acc, &ctx); | 111 | completions::qualified_path::complete_qualified_path(&mut acc, &ctx); |
128 | complete_unqualified_path::complete_unqualified_path(&mut acc, &ctx); | 112 | completions::unqualified_path::complete_unqualified_path(&mut acc, &ctx); |
129 | complete_dot::complete_dot(&mut acc, &ctx); | 113 | completions::dot::complete_dot(&mut acc, &ctx); |
130 | complete_record::complete_record(&mut acc, &ctx); | 114 | completions::record::complete_record(&mut acc, &ctx); |
131 | complete_pattern::complete_pattern(&mut acc, &ctx); | 115 | completions::pattern::complete_pattern(&mut acc, &ctx); |
132 | complete_postfix::complete_postfix(&mut acc, &ctx); | 116 | completions::postfix::complete_postfix(&mut acc, &ctx); |
133 | complete_macro_in_item_position::complete_macro_in_item_position(&mut acc, &ctx); | 117 | completions::macro_in_item_position::complete_macro_in_item_position(&mut acc, &ctx); |
134 | complete_trait_impl::complete_trait_impl(&mut acc, &ctx); | 118 | completions::trait_impl::complete_trait_impl(&mut acc, &ctx); |
135 | complete_mod::complete_mod(&mut acc, &ctx); | 119 | completions::mod_::complete_mod(&mut acc, &ctx); |
136 | 120 | ||
137 | Some(acc) | 121 | Some(acc) |
138 | } | 122 | } |
139 | 123 | ||
140 | #[cfg(test)] | 124 | #[cfg(test)] |
141 | mod tests { | 125 | mod tests { |
142 | use crate::completion_config::CompletionConfig; | 126 | use crate::config::CompletionConfig; |
143 | use crate::test_utils; | 127 | use crate::test_utils; |
144 | 128 | ||
145 | struct DetailAndDocumentation<'a> { | 129 | struct DetailAndDocumentation<'a> { |