Don't apply highlighting to zero-length elements
#KT-19820 Fixed
This commit is contained in:
@@ -36,7 +36,7 @@ abstract class HighlightingVisitor protected constructor(
|
||||
holder.createInfoAnnotation(textRange, message)
|
||||
|
||||
protected fun highlightName(element: PsiElement, attributesKey: TextAttributesKey, message: String? = null) {
|
||||
if (NameHighlighter.namesHighlightingEnabled) {
|
||||
if (NameHighlighter.namesHighlightingEnabled && !element.textRange.isEmpty) {
|
||||
createInfoAnnotation(element, message).textAttributes = attributesKey
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+5
@@ -5,6 +5,11 @@ package testing
|
||||
<info textAttributesKey="KOTLIN_ENUM_ENTRY">SECOND</info>
|
||||
}
|
||||
|
||||
<info textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">enum</info> class <info textAttributesKey="KOTLIN_CLASS">Type</info>(val <info textAttributesKey="KOTLIN_INSTANCE_PROPERTY">id</info>: <info textAttributesKey="KOTLIN_CLASS">Int</info>) {
|
||||
<info textAttributesKey="KOTLIN_ENUM_ENTRY">FIRST</info>(1),
|
||||
<info textAttributesKey="KOTLIN_ENUM_ENTRY">SECOND</info>(2)
|
||||
}
|
||||
|
||||
fun <info textAttributesKey="KOTLIN_FUNCTION_DECLARATION">testing</info>(<info textAttributesKey="KOTLIN_PARAMETER">t1</info>: <info textAttributesKey="KOTLIN_CLASS">Test</info>, <info textAttributesKey="KOTLIN_PARAMETER">t2</info>: <info textAttributesKey="KOTLIN_CLASS">Test</info>): <info textAttributesKey="KOTLIN_CLASS">Test</info> {
|
||||
if (<info textAttributesKey="KOTLIN_PARAMETER">t1</info> != <info textAttributesKey="KOTLIN_PARAMETER">t2</info>) return <info textAttributesKey="KOTLIN_CLASS">Test</info>.<info textAttributesKey="KOTLIN_ENUM_ENTRY">FIRST</info>
|
||||
return <info textAttributesKey="KOTLIN_PACKAGE_FUNCTION_CALL">testing</info>(<info textAttributesKey="KOTLIN_CLASS">Test</info>.<info textAttributesKey="KOTLIN_ENUM_ENTRY">FIRST</info>, <info textAttributesKey="KOTLIN_CLASS">Test</info>.<info textAttributesKey="KOTLIN_ENUM_ENTRY">SECOND</info>)
|
||||
|
||||
Reference in New Issue
Block a user