Skip to content

Conversation

@artemcm
Copy link
Contributor

@artemcm artemcm commented Nov 3, 2025

These links establish group inheritance relationships amongst diagnostic groups. This takes form of a new parameter: subGroupLinks: [DiagnosticGroupIdentifier: [DiagnosticGroupIdentifier]] = [:] on both:

  • SyntaxProtocol.warningGroupBehavior
  • SyntaxProtocol.warningGroupControlRegionTree Where the dictionary key is a super-group and dictionary values are its sub-groups.

Upon encountering a warning group control (@warn), its corresponding region is populated with its identifier and behavior, as well as the same corresponding behavior for each of its sub-groups, direct and transitive.

@artemcm
Copy link
Contributor Author

artemcm commented Nov 3, 2025

@swift-ci test

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

How large do you envision subGroupLinks to be? Just thinking if it would be more efficient to take the sub group relationships into account when querying for warning controls instead of when populating the tree. Kind of depends on whether you expect to have more queries or more @warn controls.

@artemcm artemcm force-pushed the WarningControl-GroupLinks branch from a797833 to 5b18fb4 Compare November 5, 2025 18:27
@artemcm
Copy link
Contributor Author

artemcm commented Nov 5, 2025

How large do you envision subGroupLinks to be? Just thinking if it would be more efficient to take the sub group relationships into account when querying for warning controls instead of when populating the tree. Kind of depends on whether you expect to have more queries or more @warn controls.

I considered both options and went with this one to take the relationships into account at tree construction: my main reason for this is that I expect the primary client use-case (such as the compiler in swiftlang/swift#85036) to pay the cost of constructing a tree and then run queries against said tree. I do expect there to be a lot of queries against a constructed tree, and it's tricky to predict how many group relationships we will end up with since that concept is still quite new.

Baking these relationships into the constructed tree does also result in simpler query logic on the client side.

@artemcm
Copy link
Contributor Author

artemcm commented Nov 5, 2025

@swift-ci test

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Sorry, some of the comments below I should have already brought up in the last review.

@artemcm artemcm force-pushed the WarningControl-GroupLinks branch 3 times, most recently from 8feabad to 00891ac Compare November 6, 2025 02:30
@artemcm
Copy link
Contributor Author

artemcm commented Nov 6, 2025

@swift-ci test

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

A couple nitpicks, otherwise LGTM.

…ance

This takes form of a new parameter: `groupInheritanceTree: DiagnosticGroupInheritanceTree? = nil` on both:
- `SyntaxProtocol.warningGroupBehavior`
- `SyntaxProtocol.warningGroupControlRegionTree`
Where `DiagnosticGroupInheritanceTree` is a wrapper for a dictionary where the key is a super-group and values are its sub-groups.

Upon encountering a warning group control (`@warn`), its corresponding region is populated with its identifier and behavior, as well as the same corresponding behavior for each of its sub-groups, direct and transitive.
@artemcm artemcm force-pushed the WarningControl-GroupLinks branch from 00891ac to a0e1efc Compare November 6, 2025 17:11
@artemcm
Copy link
Contributor Author

artemcm commented Nov 6, 2025

@swift-ci test

@artemcm artemcm enabled auto-merge November 6, 2025 17:11
@artemcm
Copy link
Contributor Author

artemcm commented Nov 6, 2025

@swift-ci test Windows platform

1 similar comment
@artemcm
Copy link
Contributor Author

artemcm commented Nov 6, 2025

@swift-ci test Windows platform

@artemcm artemcm merged commit 02f8220 into swiftlang:main Nov 7, 2025
68 of 69 checks passed
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.

2 participants