provide a way to update AnalysisContext in code_transformer package #19275
Labels
area-pkg
Used for miscellaneous pkg/ packages not associated with specific area- teams.
type-enhancement
A request for a change that isn't a bug
This issue was originally filed by @a14n
In my zengen package I make modifications on the dart sources through pub transformers. A modification is done based on a resolved AST. Some modifications lead to other modifications that need an up-to-date AST with previous modifications.
To have this AST up to date the only solution I found was to emit the output Asset and reapply the same transformer. And redo this as long as there are code transformations done.
To avoid this recursivity (and perhaps optimize analysis) it would be worth to provide a method like Resolver.applyTextEditTransaction(xxx) (that would call the underlying analysisContext.applyChanges).
The text was updated successfully, but these errors were encountered: