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

Unified Diff: pkg/analyzer/lib/src/generated/index.dart

Issue 322603002: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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/generated/error.dart ('k') | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/index.dart
diff --git a/pkg/analyzer/lib/src/generated/index.dart b/pkg/analyzer/lib/src/generated/index.dart
index ae07ab521a3db80d8c946a01e3d86e750d697d6c..b5b5b101d79b91fad82ba80d161d08f6ebd526e6 100644
--- a/pkg/analyzer/lib/src/generated/index.dart
+++ b/pkg/analyzer/lib/src/generated/index.dart
@@ -174,6 +174,33 @@ class AngularHtmlIndexContributor extends ExpressionVisitor {
}
/**
+ * Instances of the [ClearOperation] implement an operation that removes all of the
+ * information from the index.
+ */
+class ClearOperation implements IndexOperation {
+ /**
+ * The index store against which this operation is being run.
+ */
+ final IndexStore _indexStore;
+
+ ClearOperation(this._indexStore);
+
+ @override
+ bool get isQuery => false;
+
+ @override
+ void performOperation() {
+ _indexStore.clear();
+ }
+
+ @override
+ bool removeWhenSourceRemoved(Source source) => false;
+
+ @override
+ String toString() => "ClearOperation()";
+}
+
+/**
* Recursively visits [HtmlUnit] and every embedded [Expression].
*/
abstract class ExpressionVisitor extends ht.RecursiveXmlVisitor<Object> {
@@ -265,6 +292,11 @@ class GetRelationshipsOperation implements IndexOperation {
*/
abstract class Index {
/**
+ * Asynchronously remove from the index all of the information.
+ */
+ void clear();
+
+ /**
* Asynchronously invoke the given callback with an array containing all of the locations of the
* elements that have the given relationship with the given element. For example, if the element
* represents a method and the relationship is the is-referenced-by relationship, then the
@@ -1563,6 +1595,11 @@ abstract class IndexStore {
bool aboutToIndexHtml(AnalysisContext context, HtmlElement htmlElement);
/**
+ * Removes all of the information.
+ */
+ void clear();
+
+ /**
* Return the locations of the elements that have the given relationship with the given element.
* For example, if the element represents a method and the relationship is the is-referenced-by
* relationship, then the returned locations will be all of the places where the method is
@@ -1950,6 +1987,16 @@ class MemoryIndexStoreImpl implements MemoryIndexStore {
}
@override
+ void clear() {
+ _canonicalKeys.clear();
+ _keyToLocations.clear();
+ _contextToSourceToKeys.clear();
+ _contextToSourceToLocations.clear();
+ _contextToLibraryToUnits.clear();
+ _contextToUnitToLibraries.clear();
+ }
+
+ @override
List<Location> getRelationships(Element element, Relationship relationship) {
MemoryIndexStoreImpl_ElementRelationKey key = new MemoryIndexStoreImpl_ElementRelationKey(element, relationship);
Set<Location> locations = _keyToLocations[key];
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698