pub struct EntrySummary {
pub language: LanguageId,
pub command: LaunchCommand,
pub arg_count: usize,
}Expand description
Identifies a [[lsp_servers]] entry in error messages that must let a user
tell apart two entries sharing the same ServerId — the id alone is
useless there, since it’s exactly what collided.
Deliberately does not include a positional index: ToolRouter::from_configs
only ever sees the post-heuristics applicable subset for a given
workspace, not the raw [[lsp_servers]] array, so a printed index would
usually name the wrong TOML entry (misleading, worse than omitting it).
command and the argument count distinguish the entries instead; when two entries are
truly identical in every visible field, the description is the same for
both halves, which is an honest reflection of the ambiguity.
§Examples
use mcpls_core::config::{EntrySummary, LanguageId, LaunchCommand, ServerCommand};
let summary = EntrySummary {
language: LanguageId::from_static("python"),
command: LaunchCommand::from(ServerCommand::from_static("pyright")),
arg_count: 0,
};
assert_eq!(summary.to_string(), "language 'python', command 'pyright'");Fields§
§language: LanguageIdLanguage the entry serves.
command: LaunchCommandExecutable the entry launches.
arg_count: usizeNumber of arguments passed to the executable.
Only the count is kept: arguments can carry secrets (--api-key=...)
that must not reach Display or the derived Debug of an error.
Trait Implementations§
Source§impl Clone for EntrySummary
impl Clone for EntrySummary
Source§impl Debug for EntrySummary
impl Debug for EntrySummary
Source§impl Display for EntrySummary
impl Display for EntrySummary
impl Eq for EntrySummary
Source§impl PartialEq for EntrySummary
impl PartialEq for EntrySummary
impl StructuralPartialEq for EntrySummary
Auto Trait Implementations§
impl Freeze for EntrySummary
impl RefUnwindSafe for EntrySummary
impl Send for EntrySummary
impl Sync for EntrySummary
impl Unpin for EntrySummary
impl UnsafeUnpin for EntrySummary
impl UnwindSafe for EntrySummary
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.