Skip to content

Print XML Document comments from AST #1878

@nojaf

Description

@nojaf

Currently, Fantomas is not printing PreXmlDoc (unless in strict mode is active).
Comments are detected as trivia as well so, in order not to print them twice, we don't print PreXmlDoc but print the trivia instead.
This is actually perhaps a bit inefficient as currently, we need to match the trivia with a trivia node.
The PreXmlDoc will always be assigned to the correct node in the tree, so it should be ignored as trivia instead.

Practically, I see an opportunity to capture the ranges of PreXmlDoc in ASTTransformer and eliminate trivia content in Trivia.fs.
CodePrinter would then need an additional change to always print PreXmlDoc.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions