Skip to main content

Module analyze

Module analyze 

Source
Expand description

Collect-all suite analysis: the LSP’s whole-suite recompute in one function.

Where front::run fails fast and emits artifacts, analyze_suite accumulates every diagnostic and emits the relations editors need (bindings for go-to-def/references, macros for completion/def targets). A parse-failed unit reports its own diagnostic and is skipped downstream — no cascade of bogus follow-on errors.

Structs§

AnalyzeCtx
Everything analyze_suite needs, injected at the IO edge (sans-IO core).
Binding
One prose step bound to a macro — powers go-to-definition and references.
FragmentDef
A fragment definition — the go-to-definition target for a ref:, and the vocabulary a ref: line completes against.
FragmentRef
One ref: reference inside a pack → the fragment it resolves to. Powers go-to-definition from a ref: line to the annotation in the .hurl file.
MacroRef
A macro definition — powers completion and is the go-to-definition target.
SuiteAnalysis
The product of one wholesale recompute: every feature’s read from here.
UseRef
One use: reference inside a pack → the macro it resolves to. Powers go-to-definition from a use: line to the target macro’s definition.

Functions§

analyze_suite
Recompute the whole suite in one pass: read every pack and feature through the provider, accumulate every diagnostic per source name, and record the binding and macro relations editors need. A broken pack contributes its own diagnostic and is excluded from the loaded set, but does not stop the rest of the suite from binding; a parse-failed feature is skipped, not fatal.
validate_artifact
Parse-validate the exact emitted artifact text with the claiming engine’s real parser (--dry-run = §4.1–4.5 including artifact parse-validation). The diagnostic’s source is the emitted text itself, span at the broken line.