| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import 'dart:async'; |
| 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/src/dart/analysis/ast_provider_driver.dart'; |
| 10 import 'package:analyzer/src/generated/engine.dart'; |
| 11 |
| 12 class AstProviderForContext extends AbstractAstProvider { |
| 13 final AnalysisContext context; |
| 14 |
| 15 AstProviderForContext(this.context); |
| 16 |
| 17 @override |
| 18 Future<CompilationUnit> getParsedUnitForElement(Element element) async { |
| 19 return context.parseCompilationUnit(element.source); |
| 20 } |
| 21 |
| 22 @override |
| 23 Future<CompilationUnit> getResolvedUnitForElement(Element element) async { |
| 24 return context.getResolvedCompilationUnit2( |
| 25 element.source, element.librarySource); |
| 26 } |
| 27 } |
| OLD | NEW |