pub struct ServerHeuristics {
pub project_markers: Vec<String>,
}Expand description
Heuristics for determining if an LSP server should be spawned.
Used to prevent spawning servers in projects where they are not applicable (e.g., rust-analyzer in a Python-only project).
Fields§
§project_markers: Vec<String>Files or directories that indicate this server is applicable. The server will spawn if ANY of these markers exist in the workspace root. If empty, the server will always attempt to spawn.
Implementations§
Source§impl ServerHeuristics
impl ServerHeuristics
Sourcepub fn with_markers<I, S>(markers: I) -> Self
pub fn with_markers<I, S>(markers: I) -> Self
Create heuristics with the given project markers.
Sourcepub fn is_applicable(&self, workspace_root: &Path) -> bool
pub fn is_applicable(&self, workspace_root: &Path) -> bool
Check if any marker exists at the given workspace root.
Returns true if:
- No markers are defined (empty = always applicable)
- At least one marker file/directory exists
Trait Implementations§
Source§impl Clone for ServerHeuristics
impl Clone for ServerHeuristics
Source§fn clone(&self) -> ServerHeuristics
fn clone(&self) -> ServerHeuristics
Returns a duplicate of the value. Read more
1.0.0 · 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 ServerHeuristics
impl Debug for ServerHeuristics
Source§impl Default for ServerHeuristics
impl Default for ServerHeuristics
Source§fn default() -> ServerHeuristics
fn default() -> ServerHeuristics
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ServerHeuristics
impl<'de> Deserialize<'de> for ServerHeuristics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ServerHeuristics
impl RefUnwindSafe for ServerHeuristics
impl Send for ServerHeuristics
impl Sync for ServerHeuristics
impl Unpin for ServerHeuristics
impl UnwindSafe for ServerHeuristics
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