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

Unified Diff: pkg/analysis_server/lib/src/services/index/index.dart

Issue 971833003: Optimize top-level element declarations search. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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
Index: pkg/analysis_server/lib/src/services/index/index.dart
diff --git a/pkg/analysis_server/lib/src/services/index/index.dart b/pkg/analysis_server/lib/src/services/index/index.dart
index 6864e17c289c444a1edff8cab7f061df16d6537a..7cc6d251c8b5a2fad933fbae87d9ff0eb61778e5 100644
--- a/pkg/analysis_server/lib/src/services/index/index.dart
+++ b/pkg/analysis_server/lib/src/services/index/index.dart
@@ -14,6 +14,12 @@ import 'package:analyzer/src/generated/source.dart';
/**
+ * A filter for [Element] names.
+ */
+typedef ElementNameFilter(String name);
+
+
+/**
* The interface [Index] defines the behavior of objects that maintain an index
* storing relations between [Element]s.
*
@@ -50,6 +56,11 @@ abstract class Index {
Relationship relationship);
/**
+ * Returns top-level [Element]s whose names satisfy to [nameFilter].
+ */
+ List<Element> getTopDeclarations(ElementNameFilter nameFilter);
+
+ /**
* Processes the given [HtmlUnit] in order to record the relationships.
*
* [context] - the [AnalysisContext] in which [HtmlUnit] was resolved.
@@ -357,20 +368,3 @@ class Relationship {
return relationship;
}
}
-
-
-/**
- * An element to use when we want to request "defines" relations without
- * specifying an exact library.
- */
-class UniverseElement extends ElementImpl {
- static final UniverseElement INSTANCE = new UniverseElement._();
-
- UniverseElement._() : super("--universe--", -1);
-
- @override
- ElementKind get kind => ElementKind.UNIVERSE;
-
- @override
- accept(ElementVisitor visitor) => null;
-}

Powered by Google App Engine
This is Rietveld 408576698