Skip to main content

LspEngine

Struct LspEngine 

Source
pub struct LspEngine { /* private fields */ }

Implementations§

Source§

impl LspEngine

Source

pub fn new(config: LspEngineConfig) -> Self

Source

pub fn set_install_progress(&mut self, progress: Arc<dyn InstallProgress>)

Source

pub fn startup_timeout(&self) -> Duration

Source

pub fn start_for_context( &mut self, root_path: &Path, files: &[&Path], ) -> Result<()>

Source

pub fn server_state(&self, lang: Language) -> ServerState

Source

pub fn await_ready( &mut self, lang: Language, timeout: Duration, ) -> Result<ServerState>

Source

pub fn any_pending(&self) -> bool

Source

pub fn poll_events(&mut self) -> Vec<LspEvent>

Source

pub fn shutdown_all(&mut self)

Source

pub fn install_server(&mut self, lang: Language) -> Result<()>

Source

pub fn restart_server(&mut self, lang: Language) -> Result<()>

Restart a server that has Failed (or Stopped). Tears down any lingering process, then re-runs the full startup pipeline.

Source

pub fn status_summary(&self) -> Vec<(Language, ServerState)>

Source

pub fn document_symbols( &mut self, file_path: &Path, ) -> Result<Vec<DocumentSymbol>>

Source

pub fn symbol_at_position( &mut self, file_path: &Path, line: usize, col: usize, ) -> Result<Option<DocumentSymbol>>

Source

pub fn symbol_range( &mut self, file_path: &Path, symbol_name: &str, ) -> Result<Option<SymbolRange>>

Source

pub fn notify_document_open( &mut self, file_path: &Path, content: &str, ) -> Result<()>

Source

pub fn notify_document_change( &mut self, file_path: &Path, content: &str, version: i32, ) -> Result<()>

Source

pub fn completions( &mut self, file_path: &Path, line: usize, col: usize, ) -> Result<Vec<CompletionItem>>

Source

pub fn hover( &mut self, file_path: &Path, line: usize, col: usize, ) -> Result<Option<HoverInfo>>

Source

pub fn goto_definition( &mut self, file_path: &Path, line: usize, col: usize, ) -> Result<Option<Location>>

Source

pub fn semantic_tokens( &mut self, file_path: &Path, content: &str, ) -> Result<Vec<SemanticToken>>

Source

pub fn selection_range( &mut self, file_path: &Path, line: usize, col: usize, ) -> Result<SelectionRange>

Trait Implementations§

Source§

impl Drop for LspEngine

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.