Repository navigation
Keep a comment after the of keyword of a union case - #3502
Merged
Merged
Conversation
The syntax tree had no range for the `of` keyword of a union case or exception. The keyword was printed as plain text, so a block comment after it, as in `exception E of (*name*) string`, was attached to the case name and moved in front of `of`. Update FCS to 'Record the range of the `of` keyword in SynUnionCaseTrivia', commit 5e9647f158fe282462aba57ed83ada910a91b90e, which adds that range to SynUnionCaseTrivia. UnionCaseNode now has an OfKeyword node built from it, so a comment attaches to the side of the keyword it was written on. The wordOf helper is no longer used and is removed. Fixes fsprojects#1959
This was referenced Oct 1, 2026
This was referenced Oct 26, 2026
This was referenced Nov 4, 2026
This was referenced Nov 14, 2026
This was referenced Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The syntax tree had no range for the
ofkeyword of a union case or exception. The keyword was printed as plain text, so a block comment after it, as inexception E of (*name*) string, was attached to the case name and moved in front ofof.Update FCS to 'Record the range of the
ofkeyword in SynUnionCaseTrivia', commit 5e9647f158fe282462aba57ed83ada910a91b90e, which adds that range to SynUnionCaseTrivia. UnionCaseNode now has an OfKeyword node built from it, so a comment attaches to the side of the keyword it was written on. The wordOf helper is no longer used and is removed.Fixes #1959