mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] Do not show a parameter inlay hint when parameter has the same prefix as parameter name
#KTIJ-32872 GitOrigin-RevId: 0e2031d47e3ce3a2f0519a73adf4964f814861bb
This commit is contained in:
committed by
intellij-monorepo-bot
parent
bd4b175d97
commit
c46cf087d1
+5
-2
@@ -141,8 +141,11 @@ class KtParameterHintsProvider : AbstractKtInlayHintsProvider() {
|
||||
val symbolName = symbol.name.asString()
|
||||
if (argumentText == symbolName) return true
|
||||
|
||||
// avoid cases like "`value =` myValue"
|
||||
if (symbolName.length > 1 && argumentText.endsWith(symbolName[0].uppercaseChar() + symbolName.substring(1))) return true
|
||||
if (symbolName.length > 1) {
|
||||
val name = symbolName[0].uppercaseChar() + symbolName.substring(1)
|
||||
// avoid cases like "`type = Type(...)`" and "`value =` myValue"
|
||||
if (argumentText.startsWith(name) || argumentText.endsWith(name)) return true
|
||||
}
|
||||
|
||||
// avoid cases like "/* value = */ value"
|
||||
var sibling: PsiElement? = this.prevSibling
|
||||
|
||||
+8
-1
@@ -17,4 +17,11 @@ fun m() {
|
||||
simpleFun2(name)
|
||||
simpleFun2(myName)
|
||||
simpleFun2(/*<# [namedParameters.kt:125]name| = #>*/n)
|
||||
}
|
||||
}
|
||||
|
||||
class Buzz(val name: String)
|
||||
|
||||
fun buzzyFun(buzz: Buzz) {
|
||||
buzzyFun(Buzz(name))
|
||||
buzzyFun(Buzz(/*<# [namedParameters.kt:546]name| = #>*/"me"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user