diff options
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r-- | crates/ra_analysis/src/completion.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/crates/ra_analysis/src/completion.rs b/crates/ra_analysis/src/completion.rs index 739ca6ae8..ce777a771 100644 --- a/crates/ra_analysis/src/completion.rs +++ b/crates/ra_analysis/src/completion.rs | |||
@@ -28,7 +28,21 @@ pub use crate::completion::completion_item::{CompletionItem, InsertText, Complet | |||
28 | /// incomplete and can look really weird. | 28 | /// incomplete and can look really weird. |
29 | /// | 29 | /// |
30 | /// Once the context is collected, we run a series of completion routines which | 30 | /// Once the context is collected, we run a series of completion routines which |
31 | /// look at the context and produce completion items. | 31 | /// look at the context and produce completion items. One subtelty about this |
32 | /// phase is that completion engine should not filter by the substring which is | ||
33 | /// already present, it should give all possible variants for the identifier at | ||
34 | /// the caret. In other words, for | ||
35 | /// | ||
36 | /// ```no-run | ||
37 | /// fn f() { | ||
38 | /// let foo = 92; | ||
39 | /// let _ = bar<|> | ||
40 | /// } | ||
41 | /// ``` | ||
42 | /// | ||
43 | /// `foo` *should* be present among the completion variants. Filtering by | ||
44 | /// identifier prefix/fuzzy match should be done higher in the stack, together | ||
45 | /// with ordering of completions (currently this is done by the client). | ||
32 | pub(crate) fn completions( | 46 | pub(crate) fn completions( |
33 | db: &db::RootDatabase, | 47 | db: &db::RootDatabase, |
34 | position: FilePosition, | 48 | position: FilePosition, |