rune-langium / core/src / ParseResult
Interface: ParseResult
Defined in: packages/core/src/api/parse.ts:28
Result of parsing a Rosetta DSL source string.
Remarks
Even when hasErrors is false, the returned value is always a valid (possibly partial) RosettaModel. Callers should check hasErrors before relying on cross-reference resolution — unresolved references in the AST will have ref === undefined.
Pitfalls
- Do NOT mutate fields on the returned
value— Langium's incremental reparser tracks AST identity; mutating nodes bypasses indexing and causes stale cross-references on the next build. LangiumDocumentobjects obtained via lower-level APIs must not be cached across workspace changes — cross-references become stale afterDocumentBuilder.update()invalidates the index.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
hasErrors | boolean | Whether the parse completed without errors. | packages/core/src/api/parse.ts:46 |
lexerErrors | { column?: number; line?: number; message: string; offset: number; }[] | Lexer errors encountered during parsing. | packages/core/src/api/parse.ts:32 |
parserErrors | { column?: number; line?: number; message: string; offset?: number; }[] | Parser errors encountered during parsing. | packages/core/src/api/parse.ts:39 |
value | RosettaModel | The root AST node. | packages/core/src/api/parse.ts:30 |