pub struct LspClient { /* private fields */ }Expand description
LSP Client for a single language server
Implementations§
Source§impl LspClient
impl LspClient
Sourcepub async fn new(config: LspConfig) -> Result<Self>
pub async fn new(config: LspConfig) -> Result<Self>
Create a new LSP client with the given configuration
Sourcepub async fn for_language(
language: &str,
root_uri: Option<String>,
) -> Result<Self>
pub async fn for_language( language: &str, root_uri: Option<String>, ) -> Result<Self>
Create an LSP client for a specific language
Sourcepub async fn initialize(&self) -> Result<()>
pub async fn initialize(&self) -> Result<()>
Initialize the language server
Sourcepub async fn open_document(&self, path: &Path, content: &str) -> Result<()>
pub async fn open_document(&self, path: &Path, content: &str) -> Result<()>
Open a text document
Sourcepub async fn close_document(&self, path: &Path) -> Result<()>
pub async fn close_document(&self, path: &Path) -> Result<()>
Close a text document
Sourcepub async fn change_document(&self, path: &Path, content: &str) -> Result<()>
pub async fn change_document(&self, path: &Path, content: &str) -> Result<()>
Update a text document
Sourcepub async fn go_to_definition(
&self,
path: &Path,
line: u32,
character: u32,
) -> Result<LspActionResult>
pub async fn go_to_definition( &self, path: &Path, line: u32, character: u32, ) -> Result<LspActionResult>
Go to definition
Sourcepub async fn find_references(
&self,
path: &Path,
line: u32,
character: u32,
include_declaration: bool,
) -> Result<LspActionResult>
pub async fn find_references( &self, path: &Path, line: u32, character: u32, include_declaration: bool, ) -> Result<LspActionResult>
Find references
Sourcepub async fn hover(
&self,
path: &Path,
line: u32,
character: u32,
) -> Result<LspActionResult>
pub async fn hover( &self, path: &Path, line: u32, character: u32, ) -> Result<LspActionResult>
Get hover information
Sourcepub async fn document_symbols(&self, path: &Path) -> Result<LspActionResult>
pub async fn document_symbols(&self, path: &Path) -> Result<LspActionResult>
Get document symbols
Sourcepub async fn workspace_symbols(&self, query: &str) -> Result<LspActionResult>
pub async fn workspace_symbols(&self, query: &str) -> Result<LspActionResult>
Search workspace symbols
Sourcepub async fn go_to_implementation(
&self,
path: &Path,
line: u32,
character: u32,
) -> Result<LspActionResult>
pub async fn go_to_implementation( &self, path: &Path, line: u32, character: u32, ) -> Result<LspActionResult>
Go to implementation
Sourcepub async fn completion(
&self,
path: &Path,
line: u32,
character: u32,
) -> Result<LspActionResult>
pub async fn completion( &self, path: &Path, line: u32, character: u32, ) -> Result<LspActionResult>
Get code completions
Sourcepub async fn capabilities(&self) -> Option<ServerCapabilities>
pub async fn capabilities(&self) -> Option<ServerCapabilities>
Get the server capabilities
Sourcepub fn handles_file(&self, path: &Path) -> bool
pub fn handles_file(&self, path: &Path) -> bool
Check if this client handles the given file extension
Sourcepub fn handles_language(&self, language: &str) -> bool
pub fn handles_language(&self, language: &str) -> bool
Check if this client handles a language by name
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more