Replace deprecated toMap usages with toMapBy
This commit is contained in:
+1
-1
@@ -2,4 +2,4 @@ fun foo(list: List<String>) {
|
||||
list.<caret>
|
||||
}
|
||||
// EXIST: { itemText: "firstOrNull", tailText: " {...} (predicate: (String) -> Boolean) for Iterable<T> in kotlin", typeText: "String?" }
|
||||
// EXIST: { itemText: "toMap", tailText: " {...} (selector: (String) -> K) for Iterable<T> in kotlin", typeText: "Map<K, String>" }
|
||||
// EXIST: { itemText: "toMapBy", tailText: " {...} (selector: (String) -> K) for Iterable<T> in kotlin", typeText: "Map<K, String>" }
|
||||
|
||||
@@ -52,7 +52,7 @@ public fun Call.mapArgumentsToParameters(targetDescriptor: CallableDescriptor):
|
||||
if (parameters.isEmpty()) return emptyMap()
|
||||
|
||||
val map = HashMap<ValueArgument, ValueParameterDescriptor>()
|
||||
val parametersByName = parameters.toMap { it.getName() }
|
||||
val parametersByName = parameters.toMapBy { it.getName() }
|
||||
|
||||
var positionalArgumentIndex: Int? = 0
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public abstract class AbstractMemberPullPushTest : KotlinLightCodeInsightFixture
|
||||
val extraFiles = mainFile.parentFile.listFiles { file, name ->
|
||||
name != mainFileName && name.startsWith("$mainFileBaseName.") && (name.endsWith(".kt") || name.endsWith(".java"))
|
||||
}
|
||||
val extraFilesToPsi = extraFiles.toMap { fixture.configureByFile(it.getName()) }
|
||||
val extraFilesToPsi = extraFiles.toMapBy { fixture.configureByFile(it.getName()) }
|
||||
val file = fixture.configureByFile(mainFileName)
|
||||
|
||||
val addKotlinRuntime = InTextDirectivesUtils.findStringWithPrefixes(file.text, "// WITH_RUNTIME") != null
|
||||
|
||||
+1
-1
@@ -319,7 +319,7 @@ public abstract class AbstractExtractionTest() : KotlinLightCodeInsightFixtureTe
|
||||
val extraFiles = mainFile.getParentFile().listFiles { file, name ->
|
||||
name != mainFileName && name.startsWith("$mainFileBaseName.") && (name.endsWith(".kt") || name.endsWith(".java"))
|
||||
}
|
||||
val extraFilesToPsi = extraFiles.toMap { fixture.configureByFile(it.getName()) }
|
||||
val extraFilesToPsi = extraFiles.toMapBy { fixture.configureByFile(it.getName()) }
|
||||
val file = fixture.configureByFile(mainFileName)
|
||||
|
||||
val addKotlinRuntime = InTextDirectivesUtils.findStringWithPrefixes(file.getText(), "// WITH_RUNTIME") != null
|
||||
|
||||
Reference in New Issue
Block a user