Properties with custom property declarations highlighting rule.

Added support for package and class-level properties with custom PD.
Java syntethic extensions are ignored from this rule.

 #KT-30806 Fixed
This commit is contained in:
Vladimir Ilmov
2019-11-07 12:09:46 +03:00
parent bf37572b93
commit e2b91cfec7
11 changed files with 114 additions and 10 deletions
+2 -2
View File
@@ -1,13 +1,13 @@
// EXPECTED_DUPLICATED_HIGHLIGHTING
// FALSE_POSITIVE
var <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE">my</info></info> = 0
var <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY_CUSTOM_PROPERTY_DECLARATION"><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">field</info></info>
<info textAttributesKey="KOTLIN_KEYWORD">set</info>(<info textAttributesKey="KOTLIN_PARAMETER">arg</info>) {
<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> {
val <info textAttributesKey="KOTLIN_LOCAL_VARIABLE">field</info> = <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE">my</info></info>
val <info textAttributesKey="KOTLIN_LOCAL_VARIABLE">field</info> = <info textAttributesKey="KOTLIN_PACKAGE_PROPERTY_CUSTOM_PROPERTY_DECLARATION"><info textAttributesKey="KOTLIN_MUTABLE_VARIABLE">my</info></info>
return <info textAttributesKey="KOTLIN_LOCAL_VARIABLE">field</info>
}