Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(487)

Side by Side Diff: pkg/analyzer/lib/src/dart/analysis/ast_provider_context.dart

Issue 2969793002: Clean up AstProvider hierarchy (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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/dart/element/ast_provider.dart';
11 import 'package:analyzer/src/generated/engine.dart';
12
13 /**
14 * [AstProvider] implementation for [AnalysisContext].
15 */
16 class AstProviderForContext extends AbstractAstProvider {
17 final AnalysisContext context;
18
19 AstProviderForContext(this.context);
20
21 @override
22 Future<CompilationUnit> getParsedUnitForElement(Element element) async {
23 return context.parseCompilationUnit(element.source);
24 }
25
26 @override
27 Future<CompilationUnit> getResolvedUnitForElement(Element element) async {
28 return context.getResolvedCompilationUnit2(
29 element.source, element.librarySource);
30 }
31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698