pub struct LspReferencesService { /* private fields */ }Expand description
Per-view state: the origin to re-query, keyed by the view’s
BufferId, plus a DocumentId → BufferId index for cleanup.
The second map is not redundant. Event::DocumentClosed carries a
DocumentId, and the two ids are NOT interchangeable — the
multibuffer registry keeps a separate remove_by_document_id for
the same reason. Recording the pair at creation is cheaper than
walking every view on each close.
Implementations§
Source§impl LspReferencesService
impl LspReferencesService
pub fn new() -> Self
pub fn set_origin(&self, view: BufferId, origin: ReferencesOrigin)
Sourcepub fn index_document(&self, document: DocumentId, view: BufferId)
pub fn index_document(&self, document: DocumentId, view: BufferId)
Record the view’s document id so a DocumentClosed event can
find it.
Sourcepub fn forget_by_document_id(&self, document: DocumentId) -> bool
pub fn forget_by_document_id(&self, document: DocumentId) -> bool
Cleanup entry point for the DocumentClosed subscriber.
Returns true when a view was forgotten.
pub fn origin(&self, view: BufferId) -> Option<ReferencesOrigin>
pub fn tracked_views(&self) -> usize
Trait Implementations§
Source§impl Debug for LspReferencesService
impl Debug for LspReferencesService
Source§impl Default for LspReferencesService
impl Default for LspReferencesService
Source§fn default() -> LspReferencesService
fn default() -> LspReferencesService
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for LspReferencesService
impl RefUnwindSafe for LspReferencesService
impl Send for LspReferencesService
impl Sync for LspReferencesService
impl Unpin for LspReferencesService
impl UnsafeUnpin for LspReferencesService
impl UnwindSafe for LspReferencesService
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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