From bed9a6178b56523641cede5290f46b994e4ba037 Mon Sep 17 00:00:00 2001 From: Mark Punzalan Date: Sat, 11 Sep 2021 07:20:20 +0000 Subject: [PATCH] KotlinHighLevelFunctionParameterInfoHandler: Fix computation of "named mode". GitOrigin-RevId: 7fbc6e06dfea4554b7b92629b565bffb7a276289 --- ...inHighLevelFunctionParameterInfoHandler.kt | 27 +++++++++---------- .../parameterInfo/functionCall/NotGreen.kt | 2 -- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/plugins/kotlin/fir/src/org/jetbrains/kotlin/idea/parameterInfo/KotlinHighLevelFunctionParameterInfoHandler.kt b/plugins/kotlin/fir/src/org/jetbrains/kotlin/idea/parameterInfo/KotlinHighLevelFunctionParameterInfoHandler.kt index f9f5d4e117bb..b508f5a09f48 100644 --- a/plugins/kotlin/fir/src/org/jetbrains/kotlin/idea/parameterInfo/KotlinHighLevelFunctionParameterInfoHandler.kt +++ b/plugins/kotlin/fir/src/org/jetbrains/kotlin/idea/parameterInfo/KotlinHighLevelFunctionParameterInfoHandler.kt @@ -322,6 +322,8 @@ abstract class KotlinHighLevelParameterInfoWithCallHandlerBase 0) { append(", ") if (markUsedUnusedParameterBorder) { - // TODO: This matches FE 1.0 plugin behavior, but consider removing "disable before highlight". - // It's odd that we disable the used parameters, even though they might match. See NamedParameter3.kt test: - // `y = false` matches, and we disable it even though the next argument could match too (e.g., `x = `). + // This is used to "disable" the used parameters, when in "named mode" and there are more unused parameters. + // See NamedParameter3.kt test. Disabling them gives a visual cue that they are already used. // Highlight the space after the comma; highlighted text needs to be at least one character long highlightStartOffset = length - 1 @@ -422,6 +423,15 @@ abstract class KotlinHighLevelParameterInfoWithCallHandlerBase