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. |
*/ |