public sealed class DocumentSyntaxThe four questions everything asks a document's headers, answered over the one list they are actually stored in.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
⚠ Computed rather than stored, and that is the whole of the fix. A field each put the headers in the tree in *field* order, so a file whose @using came above its @namespace printed back with them the other way round — and byte-exact round trip is the property the incremental reparse, the formatter and every span-to-source mapping rest on. Storing them in source order and asking questions of the list costs a walk of four nodes and cannot disagree with the file.
Each is a first-one-wins search, which is what the parser guarantees: a second @namespace or @tag stops the header loop and is reported as a stray directive, so it never reaches this list.
Fields and properties (7)
public ComponentDirectiveSyntax? ComponentThe @component header. Absent only in a file the binder rejects.
public NamespaceDirectiveSyntax? NamespaceThe @namespace header, if the file names one.
public TagDirectiveSyntax? TagThe @tag header, if the file names one.
public IEnumerable<UsingDirectiveSyntax> UsingsThe @using headers, in source order.
public SyntaxList<DirectiveSyntax> DirectivesEvery file-level header, in the order the file wrote them.
public SyntaxList<MarkupSyntax> ContentEverything after the headers: markup, code blocks and style blocks.
public SyntaxToken EndOfFileToken
Methods (7)
public override SyntaxNode? GetSlot(int index)public override void Accept(SyntaxVisitor visitor)public override TResult Accept<TResult>(SyntaxVisitor<TResult> visitor)public DocumentSyntax Update(SyntaxList<DirectiveSyntax> directives, SyntaxList<MarkupSyntax> content, SyntaxToken endOfFileToken)public DocumentSyntax WithDirectives(SyntaxList<DirectiveSyntax> directives)public DocumentSyntax WithContent(SyntaxList<MarkupSyntax> content)public DocumentSyntax WithEndOfFileToken(SyntaxToken endOfFileToken)
Used by (11)
- BinderVixen.Ui.Markup
- DocumentSyntaxVixen.Ui.Markup
- ParserTestsVixen.Ui.Markup.Tests
- RecoveryTestsVixen.Ui.Markup.Tests
- SyntaxFactoryVixen.Ui.Markup
- SyntaxRewriterVixen.Ui.Markup
- SyntaxTreeVixen.Ui.Markup
- SyntaxVisitorVixen.Ui.Markup
- SyntaxVisitorVixen.Ui.Markup
- VxmlVixen.Ui.Markup.Tests
- VxmlParserVixen.Ui.Markup