pub struct PyrightLspClient { /* private fields */ }Expand description
Pyright LSP client
Implementations§
Source§impl PyrightLspClient
impl PyrightLspClient
Sourcepub fn new(workspace_root: Option<&str>) -> Result<Self>
pub fn new(workspace_root: Option<&str>) -> Result<Self>
Create and start a new pyright LSP client
Sourcepub fn open_file(&mut self, file_path: &str, content: &str) -> Result<()>
pub fn open_file(&mut self, file_path: &str, content: &str) -> Result<()>
Open a file in the language server
Sourcepub fn update_file(
&mut self,
file_path: &str,
content: &str,
version: i32,
) -> Result<()>
pub fn update_file( &mut self, file_path: &str, content: &str, version: i32, ) -> Result<()>
Update file content in the language server
Sourcepub fn get_hover(
&mut self,
file_path: &str,
line: u32,
column: u32,
) -> Result<Option<String>>
pub fn get_hover( &mut self, file_path: &str, line: u32, column: u32, ) -> Result<Option<String>>
Get hover information (type) at a specific position
Sourcepub fn get_type_definition(
&mut self,
file_path: &str,
line: u32,
column: u32,
) -> Result<Option<String>>
pub fn get_type_definition( &mut self, file_path: &str, line: u32, column: u32, ) -> Result<Option<String>>
Get type definition location
Trait Implementations§
Source§impl Drop for PyrightLspClient
impl Drop for PyrightLspClient
Source§impl PyrightLspClientTrait for PyrightLspClient
impl PyrightLspClientTrait for PyrightLspClient
fn open_file(&mut self, file_path: &str, content: &str) -> Result<()>
fn update_file( &mut self, file_path: &str, content: &str, version: i32, ) -> Result<()>
fn query_type( &mut self, file_path: &str, content: &str, line: u32, column: u32, ) -> Result<Option<String>>
fn shutdown(&mut self) -> Result<()>
Auto Trait Implementations§
impl !Freeze for PyrightLspClient
impl RefUnwindSafe for PyrightLspClient
impl Send for PyrightLspClient
impl Sync for PyrightLspClient
impl Unpin for PyrightLspClient
impl UnsafeUnpin for PyrightLspClient
impl UnwindSafe for PyrightLspClient
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