pub struct LspManager { /* private fields */ }Expand description
Manages LSP servers lazily — one per language.
When a file is changed, the manager detects the language, spawns a server if needed, notifies it, then pulls diagnostics. Servers that fail to start are marked broken and not retried for the session.
Implementations§
Source§impl LspManager
impl LspManager
Sourcepub async fn notify_file_changed(&self, path: &Path) -> Vec<Diagnostic>
pub async fn notify_file_changed(&self, path: &Path) -> Vec<Diagnostic>
Notify that a file was changed (written/edited/patched).
Reads the file content, spawns the language server lazily, sends didOpen/didChange, waits a debounce period, then pulls diagnostics.
Returns empty if the language is unsupported, the server is broken, or the file cannot be read.
Sourcepub async fn diagnostics(&self, path: &Path) -> Vec<Diagnostic>
pub async fn diagnostics(&self, path: &Path) -> Vec<Diagnostic>
Get diagnostics for a file on demand (without notifying a change).
Auto Trait Implementations§
impl !Freeze for LspManager
impl !RefUnwindSafe for LspManager
impl Send for LspManager
impl Sync for LspManager
impl Unpin for LspManager
impl UnsafeUnpin for LspManager
impl !UnwindSafe for LspManager
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