pub struct LspServerInfo {
pub id: String,
pub extensions: Vec<String>,
pub global: bool,
pub root_detector: RootDetector,
pub spawn_fn: SpawnFn,
}Expand description
Information about an LSP server
Fields§
§id: StringUnique identifier (e.g., “rust-analyzer”, “typescript”)
extensions: Vec<String>File extensions this server handles (with leading dot)
global: boolWhether this is a global server (not project-specific)
root_detector: RootDetectorFunction to detect project root from a file path
spawn_fn: SpawnFnFunction to spawn the server
Implementations§
Source§impl LspServerInfo
impl LspServerInfo
Sourcepub fn new(
id: impl Into<String>,
extensions: Vec<&str>,
root_detector: RootDetector,
spawn_fn: SpawnFn,
) -> Self
pub fn new( id: impl Into<String>, extensions: Vec<&str>, root_detector: RootDetector, spawn_fn: SpawnFn, ) -> Self
Create a new LSP server info
Sourcepub fn handles_extension(&self, ext: &str) -> bool
pub fn handles_extension(&self, ext: &str) -> bool
Check if this server handles a given file extension
Sourcepub fn detect_root(&self, file: &Path) -> Option<PathBuf>
pub fn detect_root(&self, file: &Path) -> Option<PathBuf>
Detect the project root for a file
Sourcepub fn spawn(&self, root: &Path) -> Result<LspServerHandle>
pub fn spawn(&self, root: &Path) -> Result<LspServerHandle>
Spawn the server for a project root
Auto Trait Implementations§
impl Freeze for LspServerInfo
impl !RefUnwindSafe for LspServerInfo
impl Send for LspServerInfo
impl Sync for LspServerInfo
impl Unpin for LspServerInfo
impl !UnwindSafe for LspServerInfo
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