Use property access syntax: fix problem text and highlight range

#KT-30910 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-04-13 00:01:18 +09:00
committed by Dmitry Gridin
parent bf5b559923
commit 864f99782e
9 changed files with 76 additions and 1 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.UsePropertyAccessSyntaxInspection
@@ -0,0 +1,7 @@
// PROBLEM: none
// WITH_RUNTIME
import java.io.File
fun foo(file: File) {
file.getAbsolutePath(<caret>)
}
@@ -0,0 +1,7 @@
// PROBLEM: "Use of getter method instead of property access syntax"
// WITH_RUNTIME
import java.io.File
fun foo(file: File) {
file.getAbsolutePath<caret>()
}
@@ -0,0 +1,7 @@
// PROBLEM: "Use of getter method instead of property access syntax"
// WITH_RUNTIME
import java.io.File
fun foo(file: File) {
file.absolutePath
}
@@ -0,0 +1,5 @@
// PROBLEM: "Use of setter method instead of property access syntax"
// WITH_RUNTIME
fun foo(thread: Thread) {
thread.setName<caret>("name")
}
@@ -0,0 +1,5 @@
// PROBLEM: "Use of setter method instead of property access syntax"
// WITH_RUNTIME
fun foo(thread: Thread) {
thread.name = "name"
}