mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
explain that completion shouldn't do filtering
This commit is contained in:
parent
a4c30d7504
commit
f673529a33
1 changed files with 15 additions and 1 deletions
|
@ -28,7 +28,21 @@ pub use crate::completion::completion_item::{CompletionItem, InsertText, Complet
|
||||||
/// incomplete and can look really weird.
|
/// incomplete and can look really weird.
|
||||||
///
|
///
|
||||||
/// Once the context is collected, we run a series of completion routines which
|
/// Once the context is collected, we run a series of completion routines which
|
||||||
/// look at the context and produce completion items.
|
/// look at the context and produce completion items. One subtelty about this
|
||||||
|
/// phase is that completion engine should not filter by the substring which is
|
||||||
|
/// already present, it should give all possible variants for the identifier at
|
||||||
|
/// the caret. In other words, for
|
||||||
|
///
|
||||||
|
/// ```no-run
|
||||||
|
/// fn f() {
|
||||||
|
/// let foo = 92;
|
||||||
|
/// let _ = bar<|>
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
///
|
||||||
|
/// `foo` *should* be present among the completion variants. Filtering by
|
||||||
|
/// identifier prefix/fuzzy match should be done higher in the stack, together
|
||||||
|
/// with ordering of completions (currently this is done by the client).
|
||||||
pub(crate) fn completions(
|
pub(crate) fn completions(
|
||||||
db: &db::RootDatabase,
|
db: &db::RootDatabase,
|
||||||
position: FilePosition,
|
position: FilePosition,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue