aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-03 09:23:15 +0000
committerAleksey Kladov <[email protected]>2019-01-03 09:23:15 +0000
commitf673529a3355cdd00062c873cd4fdd100f60a243 (patch)
treea8a7a2bcd87699021d2b488a264b9d53ce3c0922 /crates/ra_analysis/src
parenta4c30d750411f09a999b201631000a08e88907fd (diff)
explain that completion shouldn't do filtering
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r--crates/ra_analysis/src/completion.rs16
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).
32pub(crate) fn completions( 46pub(crate) fn completions(
33 db: &db::RootDatabase, 47 db: &db::RootDatabase,
34 position: FilePosition, 48 position: FilePosition,