pub struct CliLspProvider { /* private fields */ }Expand description
CLI-side LspProvider wrapping an LspManager.
Implementations§
Source§impl CliLspProvider
impl CliLspProvider
Sourcepub fn new(manager: Arc<LspManager>) -> Self
pub fn new(manager: Arc<LspManager>) -> Self
Construct a provider that shares the given manager.
Sourcepub fn with_defaults(workspace_root: PathBuf) -> Self
pub fn with_defaults(workspace_root: PathBuf) -> Self
Construct a provider owning a fresh manager configured from
crate::lsp::manager::default_servers().
Sourcepub fn manager(&self) -> &LspManager
pub fn manager(&self) -> &LspManager
Borrow the wrapped manager.
Sourcepub async fn shutdown_all(&self)
pub async fn shutdown_all(&self)
Best-effort shutdown of every spawned server.
Trait Implementations§
Source§impl Clone for CliLspProvider
impl Clone for CliLspProvider
Source§fn clone(&self) -> CliLspProvider
fn clone(&self) -> CliLspProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CliLspProvider
impl Debug for CliLspProvider
Source§impl LspProvider for CliLspProvider
impl LspProvider for CliLspProvider
Source§fn ensure_started_background<'a>(
&'a self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>
fn ensure_started_background<'a>( &'a self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>
Kick off background initialisation (servers start but
ensure_ready
isn’t awaited). Idempotent.Source§fn ensure_ready<'a>(
&'a self,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'a>>
fn ensure_ready<'a>( &'a self, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'a>>
Block until at least the configured LSP servers have finished their
initialize handshake (or the operation times out per the
provider’s internal budget).Source§fn drain_diagnostics<'a>(
&'a self,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Option<DiagnosticsSummary>> + Send + 'a>>
fn drain_diagnostics<'a>( &'a self, timeout: Duration, ) -> Pin<Box<dyn Future<Output = Option<DiagnosticsSummary>> + Send + 'a>>
Drain the most recent batch of diagnostics that arrived via
textDocument/publishDiagnostics. Returns None when nothing
fresh has arrived within timeout.Source§fn read_diagnostics<'a>(
&'a self,
paths: &'a [PathBuf],
) -> Pin<Box<dyn Future<Output = Vec<FileDiagnosticEntry>> + Send + 'a>>
fn read_diagnostics<'a>( &'a self, paths: &'a [PathBuf], ) -> Pin<Box<dyn Future<Output = Vec<FileDiagnosticEntry>> + Send + 'a>>
Read the most recent cached diagnostics for the given file paths
(zero-copy snapshot — no waiting). Paths that have no fresh
diagnostics are omitted from the returned vec.
Source§fn notify_file_changed<'a>(
&'a self,
path: &'a Path,
content: &'a str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>
fn notify_file_changed<'a>( &'a self, path: &'a Path, content: &'a str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>
Notify the LSP manager that the contents of
path changed. The
manager is responsible for forwarding a workspace/didChange to
every server that owns the file. Default implementation is a no-op
so lightweight providers (e.g. test stubs) don’t have to wire it.Auto Trait Implementations§
impl !RefUnwindSafe for CliLspProvider
impl !UnwindSafe for CliLspProvider
impl Freeze for CliLspProvider
impl Send for CliLspProvider
impl Sync for CliLspProvider
impl Unpin for CliLspProvider
impl UnsafeUnpin for CliLspProvider
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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