#[non_exhaustive]pub enum BuiltinServer {
RustAnalyzer,
Pyright,
TypescriptLanguageServer,
Gopls,
Clangd,
Zls,
}Expand description
Language servers mcpls ships a default configuration for.
Single source of truth for each builtin’s executable name
(Self::as_str) and its install hint, so spawn-failure guidance
cannot drift from the defaults.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
RustAnalyzer
rust-analyzer for Rust.
Pyright
pyright for Python.
TypescriptLanguageServer
typescript-language-server for TypeScript.
Gopls
gopls for Go.
Clangd
clangd for C and C++.
Zls
zls for Zig.
Implementations§
Source§impl BuiltinServer
impl BuiltinServer
Source§impl BuiltinServer
impl BuiltinServer
Sourcepub const fn workspace_code(self) -> &'static str
pub const fn workspace_code(self) -> &'static str
The workspace-supplied code this server can run, for the message that explains why untrusted mode refused it.
Sourcepub const fn install_hint(self) -> &'static str
pub const fn install_hint(self) -> &'static str
One-line instruction for installing this server.
Sourcepub const fn early_exit_hint(self) -> Option<&'static str>
pub const fn early_exit_hint(self) -> Option<&'static str>
Likely cause of this server exiting before completing the initialize
handshake, if one is known.
Only rust-analyzer has one: rustup installs a rust-analyzer proxy
even when the component is not installed, and the proxy exits at once.
Sourcepub const fn is_npm_package(self) -> bool
pub const fn is_npm_package(self) -> bool
Whether this server is distributed through npm, and so is installed
as a .cmd shim on Windows.
Sourcepub fn matches_command(self, command: &str) -> bool
pub fn matches_command(self, command: &str) -> bool
Whether command launches this builtin: its file stem is this
server’s executable name, so an absolute path or a Windows .cmd shim
matches. Case-insensitive on Windows.
§Examples
use mcpls_core::config::BuiltinServer;
let tsls = BuiltinServer::TypescriptLanguageServer;
assert!(tsls.matches_command("typescript-language-server"));
assert!(tsls.matches_command("/usr/local/bin/typescript-language-server"));
assert!(tsls.matches_command("typescript-language-server.cmd"));
assert!(!tsls.matches_command("tsc"));Sourcepub fn from_command(command: &str) -> Option<Self>
pub fn from_command(command: &str) -> Option<Self>
Look up a builtin by its exact executable name.
§Examples
use mcpls_core::config::BuiltinServer;
assert_eq!(BuiltinServer::from_command("gopls"), Some(BuiltinServer::Gopls));
assert_eq!(BuiltinServer::from_command("/usr/bin/gopls"), None);Trait Implementations§
Source§impl Clone for BuiltinServer
impl Clone for BuiltinServer
impl Copy for BuiltinServer
Source§impl Debug for BuiltinServer
impl Debug for BuiltinServer
Source§impl Display for BuiltinServer
impl Display for BuiltinServer
impl Eq for BuiltinServer
Source§impl PartialEq for BuiltinServer
impl PartialEq for BuiltinServer
impl StructuralPartialEq for BuiltinServer
Auto Trait Implementations§
impl Freeze for BuiltinServer
impl RefUnwindSafe for BuiltinServer
impl Send for BuiltinServer
impl Sync for BuiltinServer
impl Unpin for BuiltinServer
impl UnsafeUnpin for BuiltinServer
impl UnwindSafe for BuiltinServer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.