pub struct LspClient { /* private fields */ }Expand description
Active LSP client connection
Implementations§
Source§impl LspClient
impl LspClient
Sourcepub async fn new(
server_id: impl Into<String>,
handle: LspServerHandle,
root: PathBuf,
) -> Result<Self>
pub async fn new( server_id: impl Into<String>, handle: LspServerHandle, root: PathBuf, ) -> Result<Self>
Create and initialize a new LSP client
Sourcepub fn diagnostics(&self) -> HashMap<PathBuf, Vec<Diagnostic>>
pub fn diagnostics(&self) -> HashMap<PathBuf, Vec<Diagnostic>>
Get current diagnostics
Sourcepub fn diagnostics_for_file(&self, path: &Path) -> Vec<Diagnostic>
pub fn diagnostics_for_file(&self, path: &Path) -> Vec<Diagnostic>
Get diagnostics for a specific file
Sourcepub async fn open_file(&self, path: &Path) -> Result<()>
pub async fn open_file(&self, path: &Path) -> Result<()>
Notify the server about an opened file
Sourcepub async fn hover(
&self,
path: &Path,
line: u32,
character: u32,
) -> Result<Option<Hover>>
pub async fn hover( &self, path: &Path, line: u32, character: u32, ) -> Result<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,
include_declaration: bool,
) -> Result<Vec<Location>>
pub async fn references( &self, path: &Path, line: u32, character: u32, include_declaration: bool, ) -> 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<DocumentSymbolResponse>
pub async fn document_symbols( &self, path: &Path, ) -> Result<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,
item: CallHierarchyItem,
) -> Result<Vec<CallHierarchyIncomingCall>>
pub async fn incoming_calls( &self, item: CallHierarchyItem, ) -> Result<Vec<CallHierarchyIncomingCall>>
Get incoming calls
Sourcepub async fn outgoing_calls(
&self,
item: CallHierarchyItem,
) -> Result<Vec<CallHierarchyOutgoingCall>>
pub async fn outgoing_calls( &self, item: CallHierarchyItem, ) -> Result<Vec<CallHierarchyOutgoingCall>>
Get outgoing calls
Auto Trait Implementations§
impl !Freeze for LspClient
impl RefUnwindSafe for LspClient
impl Send for LspClient
impl Sync for LspClient
impl Unpin 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> 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