pub struct SyncLspClient { /* private fields */ }Expand description
同步 LSP 客户端
Implementations§
Source§impl SyncLspClient
impl SyncLspClient
pub fn new() -> Self
pub fn initialize( &self, language: &str, root_path: &Path, ) -> LspResult<InitializeResult>
pub fn go_to_definition( &self, language: &str, file_path: &Path, position: Position, ) -> LspResult<Vec<Location>>
pub fn find_references( &self, language: &str, file_path: &Path, position: Position, include_declaration: bool, ) -> LspResult<Vec<Location>>
pub fn get_hover( &self, language: &str, file_path: &Path, position: Position, ) -> LspResult<Option<Hover>>
pub fn rename_symbol( &self, language: &str, file_path: &Path, position: Position, new_name: &str, ) -> LspResult<Option<WorkspaceEdit>>
pub fn get_document_symbols( &self, language: &str, file_path: &Path, ) -> LspResult<Vec<DocumentSymbol>>
pub fn open_document(&self, language: &str, file_path: &Path) -> LspResult<()>
pub fn close_document(&self, language: &str, file_path: &Path) -> LspResult<()>
pub fn shutdown(&self, language: &str) -> LspResult<()>
pub fn shutdown_all(&self) -> LspResult<()>
pub fn is_connected(&self, language: &str) -> bool
pub fn get_workspace_symbols( &self, language: &str, query: &str, ) -> LspResult<Vec<SymbolInformation>>
pub fn get_code_actions( &self, language: &str, file_path: &Path, range: Range, diagnostics: Vec<Diagnostic>, only: Option<Vec<CodeActionKind>>, ) -> LspResult<Vec<CodeAction>>
pub fn get_signature_help( &self, language: &str, file_path: &Path, position: Position, ) -> LspResult<Option<SignatureHelp>>
pub fn get_document_highlights( &self, language: &str, file_path: &Path, position: Position, ) -> LspResult<Vec<DocumentHighlight>>
pub fn format_document( &self, language: &str, file_path: &Path, tab_size: u32, insert_spaces: bool, ) -> LspResult<Vec<TextEdit>>
pub fn get_completions( &self, language: &str, file_path: &Path, position: Position, ) -> LspResult<Vec<CompletionItem>>
pub fn go_to_implementation( &self, language: &str, file_path: &Path, position: Position, ) -> LspResult<Vec<Location>>
pub fn go_to_type_definition( &self, language: &str, file_path: &Path, position: Position, ) -> LspResult<Option<Location>>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SyncLspClient
impl !RefUnwindSafe for SyncLspClient
impl !UnwindSafe for SyncLspClient
impl Send for SyncLspClient
impl Sync for SyncLspClient
impl Unpin for SyncLspClient
impl UnsafeUnpin for SyncLspClient
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