pub struct LspClient { /* private fields */ }Expand description
A client connected to one language server process.
Implementations§
Source§impl LspClient
impl LspClient
Sourcepub fn spawn(
kind: ServerKind,
root: PathBuf,
binary: &Path,
args: &[&str],
event_tx: Sender<LspEvent>,
) -> Result<Self>
pub fn spawn( kind: ServerKind, root: PathBuf, binary: &Path, args: &[&str], event_tx: Sender<LspEvent>, ) -> Result<Self>
Spawn a new language server process and start the background reader thread.
Sourcepub fn initialize(
&mut self,
workspace_root: &Path,
) -> Result<InitializeResult, LspError>
pub fn initialize( &mut self, workspace_root: &Path, ) -> Result<InitializeResult, LspError>
Send the initialize request and wait for response. Transition to Ready.
Sourcepub fn send_request<R>(
&mut self,
params: R::Params,
) -> Result<R::Result, LspError>
pub fn send_request<R>( &mut self, params: R::Params, ) -> Result<R::Result, LspError>
Send a request and wait for the response.
Sourcepub fn send_notification<N>(
&mut self,
params: N::Params,
) -> Result<(), LspError>
pub fn send_notification<N>( &mut self, params: N::Params, ) -> Result<(), LspError>
Send a notification (fire-and-forget).
Sourcepub fn shutdown(&mut self) -> Result<(), LspError>
pub fn shutdown(&mut self) -> Result<(), LspError>
Graceful shutdown: send shutdown request, then exit notification.
pub fn state(&self) -> ServerState
pub fn kind(&self) -> ServerKind
pub fn root(&self) -> &Path
Auto Trait Implementations§
impl !Freeze for LspClient
impl RefUnwindSafe for LspClient
impl Send for LspClient
impl Sync for LspClient
impl Unpin for LspClient
impl UnsafeUnpin for LspClient
impl UnwindSafe for LspClient
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> 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