dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.12k stars 1.57k forks source link

[Macros] Allow reporting diagnostics on class keywords/identifiers #55718

Open rrousselGit opened 4 months ago

rrousselGit commented 4 months ago

Hello!

I'm currently experimenting with macros ; in particular error handling. At the moment, we seem to have the ability to report warnings/errors on the class name, which is awesome. But in some cases, it may make more sense to show the warning in a slightly different location, such as on class keywords.

In particular, I'd like to show an error on the abstract keyword, because my macro requires a non-abstract classes.

Although I can currently show an error on the class name, it would be more developer friendly to show the error on the abstract instead

davidmorgan commented 4 months ago

Thanks! This is useful to keep track of but not high priority right now, so moving to the backlog.