Skip to content

Add adjacent comment support to hq BlockView and AttributeView queries#282

Merged
kkozik-amplify merged 2 commits intorelease/8.xfrom
comments-hq
Apr 7, 2026
Merged

Add adjacent comment support to hq BlockView and AttributeView queries#282
kkozik-amplify merged 2 commits intorelease/8.xfrom
comments-hq

Conversation

@kkozik-amplify
Copy link
Copy Markdown
Collaborator

Collect leading comments from NewLineOrCommentRule siblings in BodyView and attach them to BlockView/AttributeView via to_dict(with_comments=True). Remove the now-inaccurate --with-comments warning from hq CLI.

kkozik-amplify and others added 2 commits April 2, 2026 13:10
…on (#134)

NewLineOrCommentRule.serialize() now concatenates all child tokens instead of
only reading the first, fixing silently dropped comments in multi-token
new_line_or_comment nodes. BinaryOpRule distinguishes its trailing
new_line_or_comment (which can absorb body-level comments from the grammar)
from expression-internal comments, routing absorbed standalone comments to
__comments__ and keeping expression-internal ones in __inline_comments__.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collect leading comments from NewLineOrCommentRule siblings in BodyView and
attach them to BlockView/AttributeView via to_dict(with_comments=True).
Remove the now-inaccurate --with-comments warning from hq CLI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kkozik-amplify kkozik-amplify requested a review from a team as a code owner April 3, 2026 17:47
Base automatically changed from comments to release/8.x April 7, 2026 09:15
@kkozik-amplify kkozik-amplify merged commit 68ad804 into release/8.x Apr 7, 2026
7 of 8 checks passed
@kkozik-amplify kkozik-amplify deleted the comments-hq branch April 7, 2026 09:15
kkozik-amplify added a commit that referenced this pull request Apr 7, 2026
#282)

* Fix comment serialization: multi-token NL_OR_COMMENT and classification (#134)

NewLineOrCommentRule.serialize() now concatenates all child tokens instead of
only reading the first, fixing silently dropped comments in multi-token
new_line_or_comment nodes. BinaryOpRule distinguishes its trailing
new_line_or_comment (which can absorb body-level comments from the grammar)
from expression-internal comments, routing absorbed standalone comments to
__comments__ and keeping expression-internal ones in __inline_comments__.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add adjacent comment support to hq BlockView and AttributeView queries

Collect leading comments from NewLineOrCommentRule siblings in BodyView and
attach them to BlockView/AttributeView via to_dict(with_comments=True).
Remove the now-inaccurate --with-comments warning from hq CLI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants