pub struct Session { /* private fields */ }Expand description
Mutable LSP session state for open documents, workspaces, and settings.
Implementations§
Source§impl Session
impl Session
Sourcepub fn new(
client_capabilities: &ClientCapabilities,
position_encoding: PositionEncoding,
global: GlobalClientSettings,
workspaces: &Workspaces,
client: &Client,
) -> Result<Self>
pub fn new( client_capabilities: &ClientCapabilities, position_encoding: PositionEncoding, global: GlobalClientSettings, workspaces: &Workspaces, client: &Client, ) -> Result<Self>
Create a session from client capabilities, global settings, and workspaces.
Sourcepub fn key_from_url(&self, url: Url) -> DocumentKey
pub fn key_from_url(&self, url: Url) -> DocumentKey
Return the document key for an LSP document URL.
Sourcepub fn take_snapshot(&self, url: Url) -> Option<DocumentSnapshot>
pub fn take_snapshot(&self, url: Url) -> Option<DocumentSnapshot>
Capture a document snapshot for diagnostics, hovers, or code actions.
Sourcepub fn open_text_document(&mut self, url: Url, document: TextDocument)
pub fn open_text_document(&mut self, url: Url, document: TextDocument)
Open or replace an in-memory text document.
Auto Trait Implementations§
impl !Freeze for Session
impl !RefUnwindSafe for Session
impl !Sync for Session
impl !UnwindSafe for Session
impl Send for Session
impl Unpin for Session
impl UnsafeUnpin for Session
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