pub struct LspManager { /* private fields */ }Implementations§
Source§impl LspManager
impl LspManager
pub fn new(server_configs: Vec<LspServerConfig>) -> Result<Self, LspError>
Sourcepub fn from_json_config(configs: &Value) -> Result<Self, LspError>
pub fn from_json_config(configs: &Value) -> Result<Self, LspError>
Build an LspManager from a JSON array of server config objects.
Each element must be deserializable as LspServerConfig.
pub fn supports_path(&self, path: &Path) -> bool
pub async fn open_document( &self, path: &Path, text: &str, ) -> Result<(), LspError>
Sourcepub async fn sync_document_from_disk(&self, path: &Path) -> Result<(), LspError>
pub async fn sync_document_from_disk(&self, path: &Path) -> Result<(), LspError>
Sync a document from disk and notify the server.
Sourcepub async fn sync_and_await_diagnostics(
&self,
path: &Path,
timeout: Duration,
) -> Result<WorkspaceDiagnostics, LspError>
pub async fn sync_and_await_diagnostics( &self, path: &Path, timeout: Duration, ) -> Result<WorkspaceDiagnostics, LspError>
Sync a document from disk and wait for fresh diagnostics (up to timeout).
pub async fn change_document( &self, path: &Path, text: &str, ) -> Result<(), LspError>
pub async fn save_document(&self, path: &Path) -> Result<(), LspError>
pub async fn close_document(&self, path: &Path) -> Result<(), LspError>
pub async fn go_to_definition( &self, path: &Path, position: Position, ) -> Result<Vec<SymbolLocation>, LspError>
pub async fn find_references( &self, path: &Path, position: Position, include_declaration: bool, ) -> Result<Vec<SymbolLocation>, LspError>
Sourcepub async fn hover(
&self,
path: &Path,
position: Position,
) -> Result<Option<HoverResult>, LspError>
pub async fn hover( &self, path: &Path, position: Position, ) -> Result<Option<HoverResult>, LspError>
Request hover information at the given position.
Sourcepub async fn completion(
&self,
path: &Path,
position: Position,
) -> Result<Vec<CompletionItem>, LspError>
pub async fn completion( &self, path: &Path, position: Position, ) -> Result<Vec<CompletionItem>, LspError>
Request code completion at the given position.
Sourcepub async fn document_symbols(
&self,
path: &Path,
) -> Result<Vec<DocumentSymbolInfo>, LspError>
pub async fn document_symbols( &self, path: &Path, ) -> Result<Vec<DocumentSymbolInfo>, LspError>
Request document symbol outline.
Sourcepub async fn workspace_symbols(
&self,
query: &str,
) -> Result<Vec<SymbolLocation>, LspError>
pub async fn workspace_symbols( &self, query: &str, ) -> Result<Vec<SymbolLocation>, LspError>
Search workspace symbols matching query.
Aggregates results from every connected LSP server.
Sourcepub async fn rename(
&self,
path: &Path,
position: Position,
new_name: &str,
) -> Result<BTreeMap<PathBuf, Vec<TextEdit>>, LspError>
pub async fn rename( &self, path: &Path, position: Position, new_name: &str, ) -> Result<BTreeMap<PathBuf, Vec<TextEdit>>, LspError>
Rename a symbol at the given position.
Sourcepub async fn formatting(
&self,
path: &Path,
tab_size: u32,
insert_spaces: bool,
) -> Result<Vec<TextEdit>, LspError>
pub async fn formatting( &self, path: &Path, tab_size: u32, insert_spaces: bool, ) -> Result<Vec<TextEdit>, LspError>
Format a document using the server’s formatter.
Sourcepub async fn server_capabilities(
&self,
path: &Path,
) -> Result<ServerCapabilities, LspError>
pub async fn server_capabilities( &self, path: &Path, ) -> Result<ServerCapabilities, LspError>
Returns the server capabilities for the LSP server that handles path.
Useful for clients that want to check what the server supports.
pub async fn collect_workspace_diagnostics( &self, ) -> Result<WorkspaceDiagnostics, LspError>
pub async fn context_enrichment( &self, path: &Path, position: Position, ) -> Result<LspContextEnrichment, LspError>
pub async fn shutdown(&self) -> Result<(), LspError>
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