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

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

Issue 3000823002: Forward Kythe requests to plugins and merge in the results (Closed)
Patch Set: Created 3 years, 4 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/result_merger.dart
diff --git a/pkg/analysis_server/lib/src/plugin/result_merger.dart b/pkg/analysis_server/lib/src/plugin/result_merger.dart
index 5b262c1eb59003d6136602c683afd2a93191e8f4..06f08405ee237a386a9079bd89e96b921d173e4b 100644
--- a/pkg/analysis_server/lib/src/plugin/result_merger.dart
+++ b/pkg/analysis_server/lib/src/plugin/result_merger.dart
@@ -202,6 +202,25 @@ class ResultMerger {
}
/**
+ * Return kythe entry result parameters composed by merging the parameters in
+ * the [partialResultList].
+ *
+ * The resulting list will contain all of the kythe entries from all of the
+ * plugins. If a plugin contributes a kythe entry that is the same as the
+ * entry from a different plugin, the entry will appear twice in the list.
+ */
+ KytheGetKytheEntriesResult mergeKytheEntries(
+ List<KytheGetKytheEntriesResult> partialResultList) {
+ List<KytheEntry> mergedEntries = <KytheEntry>[];
+ Set<String> mergedFiles = new Set<String>();
+ for (KytheGetKytheEntriesResult partialResult in partialResultList) {
+ mergedEntries.addAll(partialResult.entries);
+ mergedFiles.addAll(partialResult.files);
+ }
+ return new KytheGetKytheEntriesResult(mergedEntries, mergedFiles.toList());
+ }
+
+ /**
* Return navigation notification parameters composed by merging the
* parameters in the [partialResultList].
*

Powered by Google App Engine
This is Rietveld 408576698