Struct CompletionRelevance
pub struct CompletionRelevance {
pub exact_name_match: bool,
pub type_match: Option<CompletionRelevanceTypeMatch>,
pub is_local: bool,
pub trait_: Option<CompletionRelevanceTraitInfo>,
pub is_name_already_imported: bool,
pub requires_import: bool,
pub is_private_editable: bool,
pub postfix_match: Option<CompletionRelevancePostfixMatch>,
pub function: Option<CompletionRelevanceFn>,
pub is_skipping_completion: bool,
}Fields§
§exact_name_match: boolThis is set when the identifier being completed matches up with the name that is expected, like in a function argument.
ⓘ
fn f(spam: String) {}
fn main() {
let spam = 92;
f($0) // name of local matches the name of param
}type_match: Option<CompletionRelevanceTypeMatch>See [CompletionRelevanceTypeMatch].
is_local: boolSet for local variables.
ⓘ
fn foo(a: u32) {
let b = 0;
$0 // `a` and `b` are local
}trait_: Option<CompletionRelevanceTraitInfo>Populated when the completion item comes from a trait (impl).
is_name_already_imported: boolThis is set when an import is suggested in a use item whose name is already imported.
requires_import: boolThis is set for completions that will insert a use item.
is_private_editable: boolSet for item completions that are private but in the workspace.
postfix_match: Option<CompletionRelevancePostfixMatch>Set for postfix snippet item completions
function: Option<CompletionRelevanceFn>This is set for items that are function (associated or method)
is_skipping_completion: booltrue when there is an await.method() or iter().method() completion.
Implementations§
§impl CompletionRelevance
impl CompletionRelevance
pub fn score(self) -> u32
pub fn is_relevant(&self) -> bool
pub fn is_relevant(&self) -> bool
Returns true when the score for this threshold is above some threshold such that we think it is especially likely to be relevant.
Trait Implementations§
§impl Clone for CompletionRelevance
impl Clone for CompletionRelevance
§fn clone(&self) -> CompletionRelevance
fn clone(&self) -> CompletionRelevance
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for CompletionRelevance
impl Debug for CompletionRelevance
§impl Default for CompletionRelevance
impl Default for CompletionRelevance
§fn default() -> CompletionRelevance
fn default() -> CompletionRelevance
Returns the “default value” for a type. Read more
§impl PartialEq for CompletionRelevance
impl PartialEq for CompletionRelevance
§impl UpmapFromRaFixture for CompletionRelevance
impl UpmapFromRaFixture for CompletionRelevance
fn upmap_from_ra_fixture( self, _analysis: &RaFixtureAnalysis, _virtual_file_id: FileId, _real_file_id: FileId, ) -> Result<CompletionRelevance, ()>
impl Copy for CompletionRelevance
impl Eq for CompletionRelevance
impl StructuralPartialEq for CompletionRelevance
Auto Trait Implementations§
impl Freeze for CompletionRelevance
impl RefUnwindSafe for CompletionRelevance
impl Send for CompletionRelevance
impl Sync for CompletionRelevance
impl Unpin for CompletionRelevance
impl UnwindSafe for CompletionRelevance
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more