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

Unified Diff: pkg/analyzer/lib/src/dart/element/ast_provider.dart

Issue 2677833002: Don't search for 'declaration' of elements, just name is usually enough. (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/ast_provider_driver.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/element/ast_provider.dart
diff --git a/pkg/analyzer/lib/src/dart/element/ast_provider.dart b/pkg/analyzer/lib/src/dart/element/ast_provider.dart
index f2ea1ad0a620db96c0725526afa3f77c1e72782f..312a057189f2b1ef051f89c154cc4bccdd359670 100644
--- a/pkg/analyzer/lib/src/dart/element/ast_provider.dart
+++ b/pkg/analyzer/lib/src/dart/element/ast_provider.dart
@@ -12,12 +12,13 @@ import 'package:analyzer/dart/element/element.dart';
* [AstNode]s that declare [Element]s.
*/
abstract class AstProvider {
- AstNode findNodeForElement(CompilationUnit unit, Element element);
-
/**
- * Completes with the parsed [AstNode] that declares the [element].
+ * Completes with the [SimpleIdentifier] that declares the [element]. The
+ * enclosing unit is only parsed, but not resolved. Completes with `null` if
+ * the [element] is synthetic, or the file where it is declared cannot be
+ * parsed, etc.
*/
- Future<T> getParsedNodeForElement<T extends AstNode>(Element element);
+ Future<SimpleIdentifier> getParsedNameForElement(Element element);
/**
* Completes with the parsed [CompilationUnit] that contains the [element].
@@ -25,9 +26,12 @@ abstract class AstProvider {
Future<CompilationUnit> getParsedUnitForElement(Element element);
/**
- * Completes with the resolved [AstNode] that declares the [element].
+ * Completes with the [SimpleIdentifier] that declares the [element]. The
+ * enclosing unit is fully resolved. Completes with `null` if the [element]
+ * is synthetic, or the file where it is declared cannot be parsed and
+ * resolved, etc.
*/
- Future<T> getResolvedNodeForElement<T extends AstNode>(Element element);
+ Future<SimpleIdentifier> getResolvedNameForElement(Element element);
/**
* Completes with the resolved [CompilationUnit] that contains the [element].
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/ast_provider_driver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698