diff --git a/pkg/analysis_server/lib/src/lsp/handlers/code_actions/plugins.dart b/pkg/analysis_server/lib/src/lsp/handlers/code_actions/plugins.dart index ca3f9fd28426..3c392a0f9568 100644 --- a/pkg/analysis_server/lib/src/lsp/handlers/code_actions/plugins.dart +++ b/pkg/analysis_server/lib/src/lsp/handlers/code_actions/plugins.dart @@ -61,7 +61,7 @@ class PluginCodeActionsProducer extends AbstractCodeActionsProducer { .map((response) => plugin.EditGetFixesResult.fromResponse(response)) .expand((response) => response.fixes) .map(_convertFixes) - .flattenedToList; + .flattenedToList2; } @override diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart index e2f0acd1bbfe..058205332313 100644 --- a/pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart +++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart @@ -66,7 +66,7 @@ abstract class AbstractSemanticTokensHandler return toSourceRangeNullable(lineInfo, range).mapResult((range) async { final serverTokens = await getServerResult(path, range); - final pluginHighlightRegions = getPluginResults(path).flattenedToList; + final pluginHighlightRegions = getPluginResults(path).flattenedToList2; if (token.isCancellationRequested) { return cancelled(); diff --git a/pkg/analysis_server/lib/src/lsp/mapping.dart b/pkg/analysis_server/lib/src/lsp/mapping.dart index 74670340b420..fe8551099a31 100644 --- a/pkg/analysis_server/lib/src/lsp/mapping.dart +++ b/pkg/analysis_server/lib/src/lsp/mapping.dart @@ -1166,7 +1166,7 @@ List toHighlights( .map((occurrence) => occurrence.offsets.map((offset) => lsp.DocumentHighlight( range: toRange(lineInfo, offset, occurrence.length)))) - .flattenedToSet + .flattenedToSet2 .toList(); } diff --git a/pkg/analysis_server/lib/src/lsp/semantic_tokens/legend.dart b/pkg/analysis_server/lib/src/lsp/semantic_tokens/legend.dart index 366015c5df3d..0962692af028 100644 --- a/pkg/analysis_server/lib/src/lsp/semantic_tokens/legend.dart +++ b/pkg/analysis_server/lib/src/lsp/semantic_tokens/legend.dart @@ -35,7 +35,7 @@ class SemanticTokenLegendLookup { .followedBy(CustomSemanticTokenTypes.values)) .toList(); _usedTokenModifiers = Set.of(highlightRegionTokenModifiers - .values.flattenedToList + .values.flattenedToList2 .followedBy(CustomSemanticTokenModifiers.values)) .toList(); diff --git a/pkg/analysis_server/lib/src/operation/operation_analysis.dart b/pkg/analysis_server/lib/src/operation/operation_analysis.dart index 10cffda5d5aa..c483cae95f2e 100644 --- a/pkg/analysis_server/lib/src/operation/operation_analysis.dart +++ b/pkg/analysis_server/lib/src/operation/operation_analysis.dart @@ -43,7 +43,7 @@ void sendAnalysisNotificationAnalyzedFiles(LegacyAnalysisServer server) { _sendNotification(server, () { var analyzedFiles = server.driverMap.values .map((driver) => driver.knownFiles) - .flattenedToSet; + .flattenedToSet2; // Exclude *.yaml files because IDEA Dart plugin attempts to index // all the files in folders which contain analyzed files. diff --git a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart index 8dfa0f36ff8b..04ec1342e21b 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart @@ -352,7 +352,7 @@ class TransformSetParser { if (firstEntry == null) { if (required) { var validKeysList = - translators.keys.flattenedToList.quotedAndCommaSeparatedWithOr; + translators.keys.flattenedToList2.quotedAndCommaSeparatedWithOr; _reportError(TransformSetErrorCode.missingOneOfMultipleKeys, errorNode, [validKeysList]); } diff --git a/pkg/analysis_server/lib/src/utilities/import_analyzer.dart b/pkg/analysis_server/lib/src/utilities/import_analyzer.dart index 90ecb647af13..84acdc36c052 100644 --- a/pkg/analysis_server/lib/src/utilities/import_analyzer.dart +++ b/pkg/analysis_server/lib/src/utilities/import_analyzer.dart @@ -299,7 +299,7 @@ class _ReferenceFinder extends RecursiveAstVisitor { // Extensions can be used without a prefix, so we can use any import that // brings in the extension. if (import == null && prefix == null && element is ExtensionElement) { - import = _importsByPrefix.values.flattenedToList + import = _importsByPrefix.values.flattenedToList2 .where((import) => // Because we don't know what prefix we're looking for (any is // allowed), use the imports own prefix when checking for the diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart index f22ea8b9b4bb..d010d37e757b 100644 --- a/pkg/analyzer/lib/src/dart/analysis/driver.dart +++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart @@ -2526,7 +2526,7 @@ class _DiscoverAvailableFilesTask { // Discover files in package/lib folders. var packageMap = driver._sourceFactory.packageMap; if (packageMap != null) { - folderIterator = packageMap.values.flattenedToList.iterator; + folderIterator = packageMap.values.flattenedToList2.iterator; } else { folderIterator = [].iterator; } diff --git a/pkg/analyzer/lib/src/dart/analysis/library_graph.dart b/pkg/analyzer/lib/src/dart/analysis/library_graph.dart index c1113f8fc68d..8ac71dd177a1 100644 --- a/pkg/analyzer/lib/src/dart/analysis/library_graph.dart +++ b/pkg/analyzer/lib/src/dart/analysis/library_graph.dart @@ -149,7 +149,7 @@ class _LibraryNode extends graph.Node<_LibraryNode> { .whereType() .map((export) => export.exportedLibrary), ]) - .flattenedToList + .flattenedToList2 .whereNotNull() .toSet(); diff --git a/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart b/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart index 414f0113cc1d..143eb7465b7d 100644 --- a/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart +++ b/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart @@ -497,7 +497,7 @@ class GenericInferrer { .values .where((l) => l.every((c) => c.isSatisfiedBy(_typeSystem, inferred)) == expected) - .flattenedToList; + .flattenedToList2; String unsatisfied = _formatConstraints(isSatisfied(false)); String satisfied = _formatConstraints(isSatisfied(true)); diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart index e5bffb313f84..73ffec2ae051 100644 --- a/pkg/analyzer/lib/src/fasta/ast_builder.dart +++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart @@ -3080,7 +3080,7 @@ class AstBuilder extends StackListener { debugEvent("SwitchBlock"); var membersList = popTypedList2>(caseCount); - var members = membersList.flattenedToList; + var members = membersList.flattenedToList2; Set labels = {}; for (var member in members) { diff --git a/pkg/analyzer/lib/src/summary2/library_builder.dart b/pkg/analyzer/lib/src/summary2/library_builder.dart index 9783e88ccad5..8ef11d1f78d2 100644 --- a/pkg/analyzer/lib/src/summary2/library_builder.dart +++ b/pkg/analyzer/lib/src/summary2/library_builder.dart @@ -460,7 +460,7 @@ class LibraryBuilder { } final augmentationCode = macroApplier.buildAugmentationLibraryCode( - _macroResults.flattenedToList, + _macroResults.flattenedToList2, ); if (augmentationCode == null) { return; diff --git a/pkg/analyzer/lib/src/utilities/extensions/collection.dart b/pkg/analyzer/lib/src/utilities/extensions/collection.dart index 256834a29933..81c29b907e20 100644 --- a/pkg/analyzer/lib/src/utilities/extensions/collection.dart +++ b/pkg/analyzer/lib/src/utilities/extensions/collection.dart @@ -27,14 +27,14 @@ extension IterableIterableExtension on Iterable> { /// At the moment of writing, this method is `2.75` times faster than /// `expand((e) => e)`, and `3.5` faster than `flattened` from /// `package:collection`. - List get flattenedToList { + List get flattenedToList2 { return [ for (final elements in this) ...elements, ]; } /// Elements of each iterable in this iterable. - Set get flattenedToSet { + Set get flattenedToSet2 { return { for (final elements in this) ...elements, }; diff --git a/pkg/analyzer/test/src/dart/element/inheritance_manager3_test.dart b/pkg/analyzer/test/src/dart/element/inheritance_manager3_test.dart index d6f7cc4d9584..4e4333bd95a3 100644 --- a/pkg/analyzer/test/src/dart/element/inheritance_manager3_test.dart +++ b/pkg/analyzer/test/src/dart/element/inheritance_manager3_test.dart @@ -3023,7 +3023,7 @@ class _InterfacePrinter { String name, Map> map, ) { - final isEmpty = map.values.flattenedToList.where((element) { + final isEmpty = map.values.flattenedToList2.where((element) { if (_configuration.withObjectMembers) return true; return !element.isObjectMember; }).isEmpty; diff --git a/pkg/analyzer/test/src/utilities/extensions/collection_test.dart b/pkg/analyzer/test/src/utilities/extensions/collection_test.dart index 9d824a36454a..ff867230e3c3 100644 --- a/pkg/analyzer/test/src/utilities/extensions/collection_test.dart +++ b/pkg/analyzer/test/src/utilities/extensions/collection_test.dart @@ -30,7 +30,7 @@ class IterableIterableExtensionTest { [0], [1, 2], [3, 3] - ].flattenedToList, + ].flattenedToList2, [0, 1, 2, 3, 3], ); } @@ -41,7 +41,7 @@ class IterableIterableExtensionTest { [0, 0], [1, 2, 1], [3, 3] - ].flattenedToSet, + ].flattenedToSet2, {0, 1, 2, 3}, ); }