Skip to content

Add Ast node(s) representing comments #3372

@hamnis

Description

@hamnis

Sometimes it is very useful to be able to add comments to generated code when using scalameta.
Currently this is not possible.

val instances: List[Stat] = cases.map(c => q"""
           // ${c.comment}
           case object ${c.name.termName} extends $init""")

/*
can't unquote into single-line comments
          ${c.comment}
*/

This is the same with multi-line comments.

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