You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is caused by the same root cause as #2653 — trailing comments after the last DU case / match clause fall outside the TypeDefnUnionNode.Range, so the trivia-attachment algorithm falls back to attaching them at module level (indent = 0).
A fix has been submitted (same PR as #2653). It uses a shallowest-first node search in Trivia.fs to find the enclosing TypeDefnUnionNode and attaches the comment at the correct indentation. All 2742 tests pass including a new regression test for this case.
Activity
dawedawe commentedon Nov 3, 2022
Hi Christer,
thanks for bringing this up. I think the same pointers apply here like in the issues you mention.
Fix trailing indented comment after last match clause / DU case being…
github-actions commentedon Mar 23, 2026
🤖 This is an automated response from Repo Assist.
This is caused by the same root cause as #2653 — trailing comments after the last DU case / match clause fall outside the
TypeDefnUnionNode.Range, so the trivia-attachment algorithm falls back to attaching them at module level (indent = 0).A fix has been submitted (same PR as #2653). It uses a shallowest-first node search in
Trivia.fsto find the enclosingTypeDefnUnionNodeand attaches the comment at the correct indentation. All 2742 tests pass including a new regression test for this case.Fix trailing indented comment after last match clause / DU case being…
Fix trailing blank line when file ends with comment, add regression …
Bump the dotnet-sidecars group with 6 updates (#257)
Bump the packages group with 5 updates (#106)
Bump the packages group with 6 updates (#84)