diff options
author | Aleksey Kladov <[email protected]> | 2019-01-03 09:23:15 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-03 09:23:15 +0000 |
commit | f673529a3355cdd00062c873cd4fdd100f60a243 (patch) | |
tree | a8a7a2bcd87699021d2b488a264b9d53ce3c0922 | |
parent | a4c30d750411f09a999b201631000a08e88907fd (diff) |
explain that completion shouldn't do filtering
-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, |