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