pub struct Lsp { /* private fields */ }Expand description
LSP facade providing high-level operations
Implementations§
Source§impl Lsp
impl Lsp
Sourcepub fn with_registry(working_dir: PathBuf, registry: LspRegistry) -> Self
pub fn with_registry(working_dir: PathBuf, registry: LspRegistry) -> Self
Create with custom registry
Sourcepub fn working_dir(&self) -> &Path
pub fn working_dir(&self) -> &Path
Get the working directory
Sourcepub async fn has_clients(&self, path: &Path) -> bool
pub async fn has_clients(&self, path: &Path) -> bool
Check if there are any clients available for a file
Sourcepub async fn clients_for_file(&self, path: &Path) -> Result<Vec<Arc<LspClient>>>
pub async fn clients_for_file(&self, path: &Path) -> Result<Vec<Arc<LspClient>>>
Get clients for a file (spawning if necessary)
Sourcepub async fn touch_file(
&self,
path: &Path,
wait_for_diagnostics: bool,
) -> Result<()>
pub async fn touch_file( &self, path: &Path, wait_for_diagnostics: bool, ) -> Result<()>
Touch a file (notify LSP servers about it)
Sourcepub async fn hover(
&self,
path: &Path,
line: u32,
character: u32,
) -> Result<Vec<Option<Hover>>>
pub async fn hover( &self, path: &Path, line: u32, character: u32, ) -> Result<Vec<Option<Hover>>>
Get hover information
Sourcepub async fn definition(
&self,
path: &Path,
line: u32,
character: u32,
) -> Result<Vec<Location>>
pub async fn definition( &self, path: &Path, line: u32, character: u32, ) -> Result<Vec<Location>>
Go to definition
Sourcepub async fn references(
&self,
path: &Path,
line: u32,
character: u32,
) -> Result<Vec<Location>>
pub async fn references( &self, path: &Path, line: u32, character: u32, ) -> Result<Vec<Location>>
Find references
Sourcepub async fn implementation(
&self,
path: &Path,
line: u32,
character: u32,
) -> Result<Vec<Location>>
pub async fn implementation( &self, path: &Path, line: u32, character: u32, ) -> Result<Vec<Location>>
Go to implementation
Sourcepub async fn document_symbols(
&self,
path: &Path,
) -> Result<Vec<DocumentSymbolResponse>>
pub async fn document_symbols( &self, path: &Path, ) -> Result<Vec<DocumentSymbolResponse>>
Get document symbols
Sourcepub async fn workspace_symbols(
&self,
query: &str,
) -> Result<Vec<SymbolInformation>>
pub async fn workspace_symbols( &self, query: &str, ) -> Result<Vec<SymbolInformation>>
Search workspace symbols
Sourcepub async fn prepare_call_hierarchy(
&self,
path: &Path,
line: u32,
character: u32,
) -> Result<Vec<CallHierarchyItem>>
pub async fn prepare_call_hierarchy( &self, path: &Path, line: u32, character: u32, ) -> Result<Vec<CallHierarchyItem>>
Prepare call hierarchy
Sourcepub async fn incoming_calls(
&self,
path: &Path,
line: u32,
character: u32,
) -> Result<Vec<CallHierarchyIncomingCall>>
pub async fn incoming_calls( &self, path: &Path, line: u32, character: u32, ) -> Result<Vec<CallHierarchyIncomingCall>>
Get incoming calls
Sourcepub async fn outgoing_calls(
&self,
path: &Path,
line: u32,
character: u32,
) -> Result<Vec<CallHierarchyOutgoingCall>>
pub async fn outgoing_calls( &self, path: &Path, line: u32, character: u32, ) -> Result<Vec<CallHierarchyOutgoingCall>>
Get outgoing calls
Sourcepub async fn diagnostics(&self) -> HashMap<PathBuf, Vec<Diagnostic>>
pub async fn diagnostics(&self) -> HashMap<PathBuf, Vec<Diagnostic>>
Get all diagnostics
Sourcepub async fn diagnostics_for_file(&self, path: &Path) -> Vec<Diagnostic>
pub async fn diagnostics_for_file(&self, path: &Path) -> Vec<Diagnostic>
Get diagnostics for a specific file
Auto Trait Implementations§
impl !Freeze for Lsp
impl !RefUnwindSafe for Lsp
impl Send for Lsp
impl Sync for Lsp
impl Unpin for Lsp
impl !UnwindSafe for Lsp
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> 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