Skip to content

Conversation

@artemcm
Copy link
Contributor

@artemcm artemcm commented Dec 15, 2025

using @warn(DiagGroupID, as: warning)
specifies a file-scoped diagnostic group control. This change adds detection of these controls and upon encountering one, adds a corresponding control to the file-scoped root of the warning control region tree.

This change also removes the optimization on warningGroupControlRegionTreeImpl construction which only constructs a tree that considers nodes which contain a queried location because we now have a scenario where diagnostic group behavior at a specific location can be affected by an using @warn node elsewhere in the file. I expect clients to run queries against a once-built tree for the source file, so I do not think this will have a meaningful impact, in practice.

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.

One high-level comment before I dive into a detailed review: Is using @warn only allowed at the top level or also inside declarations?

  • If it is only allowed at the top level: We could still have an API that takes a position and just doesn’t walk into declarations
  • If it is allowed inside type declarations: Does the using declaration only apply within that type, similar to applying it as an attribute to the type or does it still apply to the whole file?

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