remove LOCAL_VARIABLE highlight on top of BACKING_FIELD_VARIABLE
This commit is contained in:
+4
-3
@@ -22,6 +22,7 @@ import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
|||||||
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
|
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.VariableDescriptor
|
import org.jetbrains.kotlin.descriptors.VariableDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.impl.LocalVariableDescriptor
|
import org.jetbrains.kotlin.descriptors.impl.LocalVariableDescriptor
|
||||||
|
import org.jetbrains.kotlin.descriptors.impl.SyntheticFieldDescriptor
|
||||||
import org.jetbrains.kotlin.idea.highlighter.KotlinHighlightingColors.*
|
import org.jetbrains.kotlin.idea.highlighter.KotlinHighlightingColors.*
|
||||||
import org.jetbrains.kotlin.psi.*
|
import org.jetbrains.kotlin.psi.*
|
||||||
import org.jetbrains.kotlin.renderer.DescriptorRenderer
|
import org.jetbrains.kotlin.renderer.DescriptorRenderer
|
||||||
@@ -124,12 +125,12 @@ internal class VariablesHighlightingVisitor(holder: AnnotationHolder, bindingCon
|
|||||||
holder.createInfoAnnotation(elementToHighlight, msg).textAttributes = WRAPPED_INTO_REF
|
holder.createInfoAnnotation(elementToHighlight, msg).textAttributes = WRAPPED_INTO_REF
|
||||||
}
|
}
|
||||||
|
|
||||||
if (descriptor is LocalVariableDescriptor) {
|
if (descriptor is LocalVariableDescriptor && descriptor !is SyntheticFieldDescriptor) {
|
||||||
NameHighlighter.highlightName(holder, elementToHighlight, LOCAL_VARIABLE)
|
holder.highlightName(elementToHighlight, LOCAL_VARIABLE)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (descriptor is ValueParameterDescriptor) {
|
if (descriptor is ValueParameterDescriptor) {
|
||||||
NameHighlighter.highlightName(holder, elementToHighlight, PARAMETER)
|
holder.highlightName(elementToHighlight, PARAMETER)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
var <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE">my</info></info> = 0
|
var <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE">my</info></info> = 0
|
||||||
<info textAttributesKey="KOTLIN_KEYWORD">get</info>() = <info textAttributesKey="KOTLIN_BACKING_FIELD_VARIABLE"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE"><info textAttributesKey="KOTLIN_LOCAL_VARIABLE">field</info></info></info>
|
<info textAttributesKey="KOTLIN_KEYWORD">get</info>() = <info textAttributesKey="KOTLIN_BACKING_FIELD_VARIABLE"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE">field</info></info>
|
||||||
<info textAttributesKey="KOTLIN_KEYWORD">set</info>(<info textAttributesKey="KOTLIN_PARAMETER">arg</info>) {
|
<info textAttributesKey="KOTLIN_KEYWORD">set</info>(<info textAttributesKey="KOTLIN_PARAMETER">arg</info>) {
|
||||||
<info textAttributesKey="KOTLIN_BACKING_FIELD_VARIABLE"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE"><info textAttributesKey="KOTLIN_LOCAL_VARIABLE">field</info></info></info> = <info textAttributesKey="KOTLIN_PARAMETER">arg</info> + 1
|
<info textAttributesKey="KOTLIN_BACKING_FIELD_VARIABLE"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE">field</info></info> = <info textAttributesKey="KOTLIN_PARAMETER">arg</info> + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">foo</info>(): <info textAttributesKey="KOTLIN_CLASS">Int</info> {
|
fun <info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">foo</info>(): <info textAttributesKey="KOTLIN_CLASS">Int</info> {
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ val <info textAttributesKey="KOTLIN_CLASS">Int</info>.<info textAttributesKey="K
|
|||||||
|
|
||||||
val <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">y</info> : <info textAttributesKey="KOTLIN_CLASS">Int</info> = 1
|
val <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY">y</info> : <info textAttributesKey="KOTLIN_CLASS">Int</info> = 1
|
||||||
<info textAttributesKey="KOTLIN_KEYWORD">get</info>() {
|
<info textAttributesKey="KOTLIN_KEYWORD">get</info>() {
|
||||||
return 5.<info textAttributesKey="KOTLIN_EXTENSION_PROPERTY">sq</info> + <info textAttributesKey="KOTLIN_LOCAL_VARIABLE"><info textAttributesKey="KOTLIN_BACKING_FIELD_VARIABLE">field</info></info> + <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE">x</info></info>
|
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_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>) {
|
||||||
|
|||||||
Reference in New Issue
Block a user