Community
Participate
Working Groups
AST clients need a way to get at leading and trailing comments for statements (and other node types) so that they can do reasonable things like selecting/deleting/moving entire language construct. Part of the difficulty will be deciding on the rules for deciding which comments should be associated with which constructs. E.g.: // comment 1 statement1(); // comment 2 // comment 4 // comment 5 statement2(); // comment 6 // comment 7 // comment 8 statement3(); See bug 28268 for a discussion of the kinds of issues that arise in refactoring. One possible approach to consider is adding new scanner-based utility so that a client can expand the source range of a node after-the-fact to include the leading and/or trailing comments and whitespace that naturally belong to a construct.
Post 2.1 Support should not suppose anything about attaching comments. There should be a pluggable mechanism for associated comments to nodes, and we would provide a reasonable default one.
Reopen to set as duplicate
*** This bug has been marked as a duplicate of 53445 ***