pub struct LspLocationRow {
pub path: PathBuf,
pub line: u32,
pub col: u32,
pub preview: String,
pub marginalia: String,
pub display_spans: Vec<DisplaySpan>,
}Expand description
One row of an LSP-location source – multi-result navigation,
references, diagnostics. Carries the canonical
(path, line, col) triple the host needs to jump (LSP 0-based
line, utf-8 byte column already converted host-side) plus the
presentation pieces.
display is what the picker paints (e.g.
src/foo.rs:42:7 let bar = ...); the typed
RoutingPayload::LspLocation carries the (path, line, col) triple to the accept dispatch. marginalia is
optional and renders right-aligned (e.g. severity [E] for
diagnostics, kind [fn] for symbols once we add
documentSymbol picker).
Fields§
§path: PathBuf§line: u32LSP 0-based line.
col: u32utf-8 byte column.
preview: StringOptional preview text (e.g. the line content from the file)
to append after the path:line:col prefix. Empty string
is fine – only the prefix renders.
marginalia: StringRight-aligned annotation. Empty string skips the column.
display_spans: Vec<DisplaySpan>Syntax-highlight spans for preview.trim_start(), i.e. relative to
the preview text as it appears at the tail of the rendered display
(NOT yet offset by the path:line:col prefix). The host fills these
grep-style (grammar by file extension); into_candidate_with_routing
shifts them by the prefix length. Empty = plain preview. PH.2/PH.3
mechanism, extended to LSP location pickers.
Implementations§
Source§impl LspLocationRow
impl LspLocationRow
Sourcepub fn from_path_line_col(path: impl Into<PathBuf>, line: u32, col: u32) -> Self
pub fn from_path_line_col(path: impl Into<PathBuf>, line: u32, col: u32) -> Self
Build a row from a fully-resolved location triple. Reads
the line text from disk best-effort (callers may also
pre-populate preview).
Sourcepub fn into_candidate_with_routing(self) -> (RawCandidate, RoutingPayload)
pub fn into_candidate_with_routing(self) -> (RawCandidate, RoutingPayload)
Render as a (RawCandidate, RoutingPayload) pair (Phase
4.2.g.7 polish). text carries the user-visible
path:line:col form (matcher matches on display, so
text is observational); the routing payload carries
the typed (path, line, col) triple the jump dispatch
consumes.
Trait Implementations§
Source§impl Clone for LspLocationRow
impl Clone for LspLocationRow
Source§fn clone(&self) -> LspLocationRow
fn clone(&self) -> LspLocationRow
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more