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

Side by Side Diff: code_transformers/lib/src/resolver.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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) 2014, 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 library code_transformer.src.resolver;
6
7 import 'dart:async';
8
9 import 'package:analyzer/src/generated/ast.dart' show Expression;
10 import 'package:analyzer/src/generated/constant.dart' show EvaluationResult;
11 import 'package:analyzer/src/generated/element.dart';
12 import 'package:barback/barback.dart';
13 import 'package:source_maps/refactor.dart';
14 import 'package:source_span/source_span.dart';
15
16 /// Class for working with a barback based resolved AST.
17 abstract class Resolver {
18 /// Update the status of all the sources referenced by the entry points and
19 /// update the resolved library. If [entryPoints] is omitted, the primary
20 /// asset of [transform] is used as the only entry point.
21 ///
22 /// [release] must be called when done handling this Resolver to allow it
23 /// to be used by later phases.
24 Future<Resolver> resolve(Transform transform, [List<AssetId> entryPoints]);
25
26 /// Release this resolver so it can be updated by following transforms.
27 void release();
28
29 /// Gets the resolved Dart library for an asset, or null if the AST has not
30 /// been resolved.
31 ///
32 /// If the AST has not been resolved then this normally means that the
33 /// transformer hosting this needs to be in an earlier phase.
34 LibraryElement getLibrary(AssetId assetId);
35
36 /// Gets all libraries accessible from the entry point, recursively.
37 ///
38 /// This includes all Dart SDK libraries as well.
39 Iterable<LibraryElement> get libraries;
40
41 /// Finds the first library identified by [libraryName], or null if no
42 /// library can be found.
43 LibraryElement getLibraryByName(String libraryName);
44
45 /// Finds the first library identified by [libraryName], or null if no
46 /// library can be found.
47 ///
48 /// [uri] must be an absolute URI of the form
49 /// `[dart:|package:]path/file.dart`.
50 LibraryElement getLibraryByUri(Uri uri);
51
52 /// Resolves a fully-qualified type name (library_name.ClassName).
53 ///
54 /// This will resolve the first instance of [typeName], because of potential
55 /// library name conflicts the name is not guaranteed to be unique.
56 ClassElement getType(String typeName);
57
58 /// Resolves a fully-qualified top-level library variable
59 /// (library_name.variableName).
60 ///
61 /// This will resolve the first instance of [variableName], because of
62 /// potential library name conflicts the name is not guaranteed to be unique.
63 Element getLibraryVariable(String variableName);
64
65 /// Resolves a fully-qualified top-level library function
66 /// (library_name.functionName).
67 ///
68 /// This will resolve the first instance of [functionName], because of
69 /// potential library name conflicts the name is not guaranteed to be unique.
70 Element getLibraryFunction(String functionName);
71
72 /// Gets the result of evaluating the constant [expression] in the context of
73 /// a [library].
74 EvaluationResult evaluateConstant(
75 LibraryElement library, Expression expression);
76
77 /// Gets an URI appropriate for importing the specified library.
78 ///
79 /// Returns null if the library cannot be imported via an absolute URI or
80 /// from [from] (if provided).
81 Uri getImportUri(LibraryElement lib, {AssetId from});
82
83 /// Get the asset ID of the file containing the asset.
84 AssetId getSourceAssetId(Element element);
85
86 /// Get the source span where the specified element was defined or null if
87 /// the element came from the Dart SDK.
88 SourceSpan getSourceSpan(Element element);
89
90 /// Get a [SourceFile] with the contents of the file that defines [element],
91 /// or null if the element came from the Dart SDK.
92 SourceFile getSourceFile(Element element);
93
94 /// Creates a text edit transaction for the given element if it is able
95 /// to be edited, returns null otherwise.
96 ///
97 /// The transaction contains the entire text of the source file where the
98 /// element originated. If the element was from a library part then the
99 /// source file is the part file rather than the library.
100 TextEditTransaction createTextEditTransaction(Element element);
101 }
OLDNEW
« no previous file with comments | « code_transformers/lib/src/remove_sourcemap_comment.dart ('k') | code_transformers/lib/src/resolver_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698