pub struct LspLanguageConfig {
pub language_id: String,
pub command: String,
pub args: Vec<String>,
pub root_markers: Vec<String>,
}Expand description
LSP launch configuration for a language.
This is intentionally lightweight and does not embed lsp-types models.
Fields§
§language_id: StringLSP languageId string (e.g. "rust", "python").
command: StringLSP server command (e.g. "rust-analyzer").
args: Vec<String>Arguments passed to the LSP server (no shell quoting).
root_markers: Vec<String>Workspace root detection markers. When any marker exists in an ancestor directory of the opened file, that directory becomes the LSP root.
Markers can be files or directories (e.g. "Cargo.toml", ".git").
Implementations§
Source§impl LspLanguageConfig
impl LspLanguageConfig
Sourcepub fn detect_root_dir(&self, file_path: &Path) -> Option<PathBuf>
pub fn detect_root_dir(&self, file_path: &Path) -> Option<PathBuf>
Try to detect a workspace root directory for a given file path.
Returns None when no configured markers were found.
Sourcepub fn detect_root_dir_from_dir(&self, start_dir: &Path) -> Option<PathBuf>
pub fn detect_root_dir_from_dir(&self, start_dir: &Path) -> Option<PathBuf>
Try to detect a workspace root directory starting from a directory.
Returns None when no configured markers were found.
Trait Implementations§
Source§impl Clone for LspLanguageConfig
impl Clone for LspLanguageConfig
Source§fn clone(&self) -> LspLanguageConfig
fn clone(&self) -> LspLanguageConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LspLanguageConfig
impl Debug for LspLanguageConfig
impl Eq for LspLanguageConfig
Source§impl PartialEq for LspLanguageConfig
impl PartialEq for LspLanguageConfig
Source§fn eq(&self, other: &LspLanguageConfig) -> bool
fn eq(&self, other: &LspLanguageConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LspLanguageConfig
Auto Trait Implementations§
impl Freeze for LspLanguageConfig
impl RefUnwindSafe for LspLanguageConfig
impl Send for LspLanguageConfig
impl Sync for LspLanguageConfig
impl Unpin for LspLanguageConfig
impl UnsafeUnpin for LspLanguageConfig
impl UnwindSafe for LspLanguageConfig
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