pub struct OfferedName {
pub file: PathBuf,
pub fact: DeclFact,
pub depth: usize,
pub from: NameProvenance,
}Expand description
One name a completion can offer: where it is declared, and how far out it was found.
Fields§
§file: PathBuf§fact: DeclFact§depth: usizeHow many scopes out from the cursor the declaration was found: 0 is a name declared in the scope the
cursor is in — a local, or the scope the :: named — and larger numbers are enclosing scopes, which C++
only considers once the inner ones have been searched. The order of NameCompletions::names.
Recorded rather than left to be recomputed, for the reason ProjectMember::depth is: a consumer showing
locals above globals, or grouping by where a name came from, would otherwise have to reconstruct the walk it
was just handed the result of.
from: NameProvenanceHow far from the cursor the declaration is in the program text — the field a consumer ranks by.
OfferedName::depth counts scopes, which orders a lookup but does not answer the question a suggestion
list is judged by: a local and a name from zmmintrin.h can both be depth 2. This says which of them is
nearer — the buffer’s own scope, the buffer, a header beside it, a header it includes, or a header only
that header includes — and it is the same order C++ would find them in from the other end.
Recorded here rather than re-derived by a consumer because the derivation needs the include graph, and
the walk that produced this list already crossed it: see NameProvenance.
Trait Implementations§
Source§impl Clone for OfferedName
impl Clone for OfferedName
Source§impl Debug for OfferedName
impl Debug for OfferedName
impl Eq for OfferedName
Source§impl PartialEq for OfferedName
impl PartialEq for OfferedName
impl StructuralPartialEq for OfferedName
Auto Trait Implementations§
impl Forget for OfferedName
impl Freeze for OfferedName
impl Move for OfferedName
impl RefUnwindSafe for OfferedName
impl Send for OfferedName
impl Sync for OfferedName
impl Unpin for OfferedName
impl UnsafeUnpin for OfferedName
impl UnwindSafe for OfferedName
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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