mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-04-05 00:21:31 +00:00
remove PARAMETER highlight on top of INSTANCE_PROPERTY for primary constructor parameters
This commit is contained in:
@@ -56,7 +56,10 @@ internal class VariablesHighlightingVisitor(holder: AnnotationHolder, bindingCon
|
||||
}
|
||||
|
||||
override fun visitParameter(parameter: KtParameter) {
|
||||
visitVariableDeclaration(parameter)
|
||||
val propertyDescriptor = bindingContext.get(BindingContext.PRIMARY_CONSTRUCTOR_PARAMETER, parameter)
|
||||
if (propertyDescriptor == null) {
|
||||
visitVariableDeclaration(parameter)
|
||||
}
|
||||
super.visitParameter(parameter)
|
||||
}
|
||||
|
||||
|
||||
2
idea/testData/highlighter/SmartCast.kt
vendored
2
idea/testData/highlighter/SmartCast.kt
vendored
@@ -1,4 +1,4 @@
|
||||
class <info textAttributesKey="KOTLIN_CLASS">My</info>(val <info textAttributesKey="KOTLIN_PARAMETER"><info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">x</info></info>: <info textAttributesKey="KOTLIN_CLASS">Int</info>?)
|
||||
class <info textAttributesKey="KOTLIN_CLASS">My</info>(val <info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">x</info>: <info textAttributesKey="KOTLIN_CLASS">Int</info>?)
|
||||
|
||||
fun <info textAttributesKey="KOTLIN_CLASS">My</info>?.<info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">foo</info>(): <info textAttributesKey="KOTLIN_CLASS">Int</info> {
|
||||
if (this == null) return 42
|
||||
|
||||
4
idea/testData/highlighter/Variables.kt
vendored
4
idea/testData/highlighter/Variables.kt
vendored
@@ -10,7 +10,7 @@ val <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">y</info> : <info textAttri
|
||||
return 5.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY">sq</info> + <info textAttributesKey="KOTLIN_BACKING_FIELD_VARIABLE">field</info> + <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE">x</info></info>
|
||||
}
|
||||
|
||||
class <info textAttributesKey="KOTLIN_CLASS">Foo</info>(val <info textAttributesKey="KOTLIN_PARAMETER"><info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">a</info></info> : <info textAttributesKey="KOTLIN_CLASS">Int</info>, <info textAttributesKey="KOTLIN_PARAMETER">b</info> : <info textAttributesKey="KOTLIN_CLASS">String</info>) {
|
||||
class <info textAttributesKey="KOTLIN_CLASS">Foo</info>(val <info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">a</info> : <info textAttributesKey="KOTLIN_CLASS">Int</info>, <info textAttributesKey="KOTLIN_PARAMETER">b</info> : <info textAttributesKey="KOTLIN_CLASS">String</info>) {
|
||||
<info>init</info> {
|
||||
<info textAttributesKey="KOTLIN_PARAMETER">b</info>
|
||||
}
|
||||
@@ -26,4 +26,4 @@ class <info textAttributesKey="KOTLIN_CLASS">Foo</info>(val <info textAttributes
|
||||
}
|
||||
}
|
||||
|
||||
// NO_CHECK_WARNINGS
|
||||
// NO_CHECK_WARNINGS1
|
||||
Reference in New Issue
Block a user