aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/completion/src/lib.rs')
-rw-r--r--crates/completion/src/lib.rs62
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
3mod completion_config; 3mod config;
4mod completion_item; 4mod item;
5mod completion_context; 5mod context;
6mod presentation;
7mod patterns; 6mod patterns;
8mod generated_lint_completions; 7mod generated_lint_completions;
9#[cfg(test)] 8#[cfg(test)]
10mod test_utils; 9mod test_utils;
11 10
12mod complete_attribute; 11mod completions;
13mod complete_dot;
14mod complete_record;
15mod complete_pattern;
16mod complete_fn_param;
17mod complete_keyword;
18mod complete_snippet;
19mod complete_qualified_path;
20mod complete_unqualified_path;
21mod complete_postfix;
22mod complete_macro_in_item_position;
23mod complete_trait_impl;
24mod complete_mod;
25 12
26use ide_db::base_db::FilePosition; 13use ide_db::base_db::FilePosition;
27use ide_db::RootDatabase; 14use ide_db::RootDatabase;
28 15
29use crate::{ 16use crate::{completions::Completions, context::CompletionContext, item::CompletionKind};
30 completion_context::CompletionContext,
31 completion_item::{CompletionKind, Completions},
32};
33 17
34pub use crate::{ 18pub 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)]
141mod tests { 125mod 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> {