Class ParseDocumentParams
The parameter object for a ParseDocumentCommand. The [Method] attribute lets
the JSON-RPC layer infer the request method when the caller sends this by type.
[Method("rdcore/parser/document", Direction.ClientToServer)]
public record ParseDocumentParams : IRequest, IRequest<Unit>, IRequest<PlatformJsonEnvelope>, IBaseRequest, IEquatable<ParseDocumentParams>
- Inheritance
-
ParseDocumentParams
- Implements
-
IRequestIRequest<Unit>IRequest<PlatformJsonEnvelope>IBaseRequest
- Inherited Members
Remarks
The response is a PlatformJsonEnvelope wrapping a ModuleParseResult — the AST is polymorphic and the JSON-RPC transport's serializer cannot round-trip it (see PlatformJson).
Properties
AnchorOffset
The position of Fragment within the larger source document.
public SourcePosition AnchorOffset { get; init; }
Property Value
Remarks
Anchor offset is L0C0 (a full-document parse) unless specified otherwise.
DocumentUri
The Uri identifying the document to parse.
public Uri? DocumentUri { get; init; }
Property Value
Remarks
This identifies the document (for error locations and module identity) but does not by itself
supply source text — the parser does not read from the filesystem. A document with no backing
file (e.g. an unsaved untitled: buffer) still has a DocumentUri; only Fragment
need be a real, saved file's content.
Fragment
The source code to parse, verbatim, as currently held by the caller (which may differ from what is saved to disk, or may have no on-disk counterpart at all).
public string? Fragment { get; init; }
Property Value
Remarks
A full document is simply a fragment anchored at Zero (L0C0),
the default for AnchorOffset. A non-zero anchor identifies a sub-range fragment of
a larger document.