Skip to content

Retain comments in AST #308

@turbolent

Description

@turbolent

Issue To Be Solved

Currently the AST only retains comments for declarations if they are docstrings (/// line comments, a and /** block comments).

To be able to use the AST for formatting, it must retain also non-docstring comments.

Retain comments for:

  • Declarations
  • Statements
  • Expressions

Definition of Done

  • Add AST elements for comments:
    • Block comment
    • Line comment
  • Add a leading/trailing comments property
    • Declarations: Line and block comments
    • Statements: Line and block comments
    • Expressions: Block comments
  • Add comments to AST elements when parsing
    • Declarations
    • Statements
    • Expressions
  • Tests

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