Function collect_lsp_enrichment

Source
pub fn collect_lsp_enrichment<B: LspBackend>(
    backend: &mut B,
    document: &Document,
) -> Result<LspEnrichment, LspError>
Expand description

Collects one synchronous enrichment snapshot from advertised capabilities.

Queries run in symbol, reference, then diagnostic order and stop at the first error. Unadvertised query methods are not called and yield empty vectors. Diagnostics are current-version filtered and clamped; symbols/references are returned in backend form for later mapping. This function owns no timeout, queue, cancellation, or concurrency policy.

§Errors

Returns the first error produced by an advertised backend query.

§Examples

use ailloli_ui_editor::{code::collect_lsp_enrichment, Document, DocumentId, NoopLspBackend};
use ailloli_ui_text::TextBuffer;
let document = Document::new(DocumentId(1), TextBuffer::new());
let enrichment = collect_lsp_enrichment(&mut NoopLspBackend, &document).unwrap();
assert!(enrichment.symbols.is_empty() && enrichment.diagnostics.is_empty());