Skip to main content

DiagnosticsQuery

Trait DiagnosticsQuery 

Source
pub trait DiagnosticsQuery: Send + Sync {
    // Required method
    fn on_line(&self, buffer_id: BufferId, line: u32) -> Vec<Diagnostic>;

    // Provided methods
    fn for_uri(&self, _uri: &str) -> Vec<Diagnostic> { ... }
    fn uris_with_diagnostics(&self) -> Vec<String> { ... }
}
Expand description

L4b: read-only query handle the mode-owned diagnostic handlers in LspDiagnosticsMode use to read the cursor line’s diagnostics for gl. The impl (lattice-host) resolves buffer_id → uri → DiagnosticsLayer over the live published render state, so the mode needs no host method, no direct layer access, and no URI map of its own. Register + look up under the DiagnosticsQueryHandle alias (feedback_servicesregistry_arc_typeid).

Required Methods§

Source

fn on_line(&self, buffer_id: BufferId, line: u32) -> Vec<Diagnostic>

Diagnostics overlapping line of buffer_id, in the layer’s (line, character) order. Empty when the buffer has no URI mapped / no LSP attachment.

Provided Methods§

Source

fn for_uri(&self, _uri: &str) -> Vec<Diagnostic>

IDE-protocol I2.0: every diagnostic for the file uri (string form, e.g. file:///x.rs), in the layer’s order. Empty when the uri has no diagnostics or doesn’t parse. Generic (any consumer of the diagnostics service can use it — the Claude Code IDE peer’s getDiagnostics is the first). Default returns empty so impls that only serve the gl line query keep compiling.

Source

fn uris_with_diagnostics(&self) -> Vec<String>

IDE-protocol I2.0: every file uri (string form) that currently has diagnostics — lets a caller fan for_uri out for a workspace-wide query. Default empty.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§