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

Unified Diff: pkg/analysis_server/lib/analysis/occurrences_core.dart

Issue 1337143002: Add OCCURRENCES_CONTRIBUTOR_EXTENSION_POINT_ID. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/analysis/occurrences_core.dart
diff --git a/pkg/analysis_server/lib/analysis/occurrences_core.dart b/pkg/analysis_server/lib/analysis/occurrences_core.dart
new file mode 100644
index 0000000000000000000000000000000000000000..2e24a9b3c798093dc63cfd4e520c89f8ee211572
--- /dev/null
+++ b/pkg/analysis_server/lib/analysis/occurrences_core.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.analysis.occurrences_core;
Brian Wilkerson 2015/09/11 20:26:24 I would prefer to have this in a sub-directory nam
+
+import 'package:analysis_server/src/protocol.dart' show Element, Occurrences;
+import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
+import 'package:analyzer/src/generated/source.dart' show Source;
+
+/**
+ * An object used to produce occurrences.
+ *
+ * Clients are expected to subtype this class when implementing plugins.
+ */
+abstract class OccurrencesContributor {
+ /**
+ * Contribute occurrences into the given [collector].
+ * The [context] can be used to get analysis results.
+ */
+ void computeOccurrences(
+ OccurrencesCollector collector, AnalysisContext context, Source source);
+}
+
+/**
+ * An object that [OccurrencesContributor]s use to record occurrences into.
+ *
+ * Clients are not expected to subtype this class.
+ */
+abstract class OccurrencesCollector {
+ /**
+ * Record a new element occurrences.
+ */
+ void addOccurrences(Occurrences occurrences);
+}

Powered by Google App Engine
This is Rietveld 408576698