Obtaining source span for DartObject (computeConstantValue) #34062
Labels
analyzer-api
Issues that impact the public API of the analyzer package
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
customer-google3
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
(Reference issue is angulardart/angular#1350)
tl;dr: AngularDart has a metadata-based API for consumers:
Imagine we wanted to validate that
selector
was always the class name, kabob-cased. The best we can do today is present either a source span forclass Foo
or a source span for the entire@Component
annotation - of which it can become quite large for complex components.We'd like to be able to get a source span so we could present:
Unfortunately it looks like we lack the APIs in
package:analyzer
to do this. We could re-parse the file, and try to "recompute" what the source span would be, but that would likely be non-trivial and require a lot of ugly code. Any suggestions please?The text was updated successfully, but these errors were encountered: