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

Unified Diff: pkg/analyzer_plugin/lib/utilities/subscriptions/subscription_manager.dart

Issue 2983913002: Add utility method to SubscriptionManager (Closed)
Patch Set: Created 3 years, 5 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 | « no previous file | pkg/analyzer_plugin/test/utilities/subscriptions/subscription_manager_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_plugin/lib/utilities/subscriptions/subscription_manager.dart
diff --git a/pkg/analyzer_plugin/lib/utilities/subscriptions/subscription_manager.dart b/pkg/analyzer_plugin/lib/utilities/subscriptions/subscription_manager.dart
index c7f630e111d7c79aa77bc678b346fc8f07df3637..f20068104169bb3b0e36e8d314fcdccea7d02f15 100644
--- a/pkg/analyzer_plugin/lib/utilities/subscriptions/subscription_manager.dart
+++ b/pkg/analyzer_plugin/lib/utilities/subscriptions/subscription_manager.dart
@@ -21,6 +21,18 @@ class SubscriptionManager {
SubscriptionManager();
/**
+ * Return `true` if the file with the given [filePath] has a subscription for
+ * the given [service].
+ */
+ bool hasSubscriptionForFile(String filePath, AnalysisService service) {
+ if (_subscriptions == null) {
+ return false;
+ }
+ List<String> files = _subscriptions[service];
+ return files != null && files.contains(filePath);
+ }
+
+ /**
* Return a list of the services for which the file with the given [filePath]
* has been subscribed.
*/
« no previous file with comments | « no previous file | pkg/analyzer_plugin/test/utilities/subscriptions/subscription_manager_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698