Analysis server should not need to resolve a file in order to format it #56960
Labels
analyzer-editing-experience
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
The analysis server code for running the formatter calls
AnalysisDriver.getResolvedUnit
, which means that it won't be able to format the file until it's fully resolved it. It would be nice if it could use an analysis API that didn't require resolution, since that could in principle make formatting much faster.The reason it currently uses
AnalysisDriver.getResolvedUnit
is because it needsunit.libraryElement2.effectiveLanguageVersion
in order to tell the formatter which language version to use for formatting. But this feels like overkill; it should be possible to figure out the langauge version based on the unresolved AST and some information from the context.See discussion here: https://dart-review.googlesource.com/c/sdk/+/391840/comment/5e5314af_b5c7db9a/
The text was updated successfully, but these errors were encountered: