Skip to content

fix(fmt): retain modifier and constructor comments - #16787

Merged
figtracer merged 1 commit into
masterfrom
fig/fmt-modifier-comments
Sep 10, 2026
Merged

fix(fmt): retain modifier and constructor comments#16787
figtracer merged 1 commit into
masterfrom
fig/fmt-modifier-comments

Conversation

@figtracer

Copy link
Copy Markdown
Member

forge fmt drops comments before modifier and constructor bodies because the attribute mapper consumes them even when the header has no attributes. Leave those comments for the body printer, with regression coverage for line and block comments and a control case with an attributed modifier. Written with Codex assistance for implementation and regression tests.

Leave comments before bodies in the main comment stream when a header has no attributes. This prevents the attribute mapper from silently dropping modifier and constructor comments.
@github-actions

Copy link
Copy Markdown
Contributor

✅ Changelog found

The deterministic check will validate the changed entry.

@figtracer
figtracer marked this pull request as ready for review September 10, 2026 19:52

@mattsse mattsse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@figtracer
figtracer merged commit 77f95be into master Sep 10, 2026
41 of 42 checks passed
@figtracer
figtracer deleted the fig/fmt-modifier-comments branch September 10, 2026 21:17
@github-project-automation github-project-automation Bot moved this to Done in Foundry Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants