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

Unified Diff: pkg/analysis_server/lib/src/plugin/plugin_manager.dart

Issue 2830863002: Initial support for getting fixes from plugins (Closed)
Patch Set: Created 3 years, 8 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/plugin/plugin_manager.dart
diff --git a/pkg/analysis_server/lib/src/plugin/plugin_manager.dart b/pkg/analysis_server/lib/src/plugin/plugin_manager.dart
index d503d926eb1889d1a27d691c66c348f2d1e55191..645cb4c948d86d8f2882acada4acd024faffd9b3 100644
--- a/pkg/analysis_server/lib/src/plugin/plugin_manager.dart
+++ b/pkg/analysis_server/lib/src/plugin/plugin_manager.dart
@@ -25,7 +25,6 @@ import 'package:path/path.dart' as path;
/**
* Information about a single plugin.
*/
-@visibleForTesting
class PluginInfo {
/**
* The path to the root directory of the definition of the plugin on disk (the
@@ -73,6 +72,12 @@ class PluginInfo {
this.notificationManager, this.instrumentationService);
/**
+ * Return the data known about this plugin.
+ */
+ PluginData get data =>
+ new PluginData(path, currentSession?.name, currentSession?.version);
+
+ /**
* Add the given [contextRoot] to the set of context roots being analyzed by
* this plugin.
*/
@@ -198,12 +203,15 @@ class PluginManager {
* containing futures that will complete when each of the plugins have sent a
* response.
*/
- List<Future<Response>> broadcast(
+ Map<PluginInfo, Future<Response>> broadcast(
analyzer.ContextRoot contextRoot, RequestParams params) {
List<PluginInfo> plugins = pluginsForContextRoot(contextRoot);
- return plugins
- .map((PluginInfo plugin) => plugin.currentSession?.sendRequest(params))
- .toList();
+ Map<PluginInfo, Future<Response>> responseMap =
+ <PluginInfo, Future<Response>>{};
+ for (PluginInfo plugin in plugins) {
+ responseMap[plugin] = plugin.currentSession?.sendRequest(params);
+ }
+ return responseMap;
}
/**

Powered by Google App Engine
This is Rietveld 408576698