Add filtering of suggested expressions for postfix templates

Do not suggest qualified expression's selector or a part of user type
because they aren't really independent expressions
This commit is contained in:
Denis Zharkov
2016-09-22 14:08:25 +03:00
parent ab2b6743df
commit 23c0bdbd05
8 changed files with 63 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
class A
fun foo(a: Any) {
// Do not suggest 'A' as an expression to parenthesize
a as A.par<caret>
}
@@ -0,0 +1,5 @@
class A
fun foo(a: Any) {
// Do not suggest 'A' as an expression to parenthesize
(a as A)
}
+6
View File
@@ -0,0 +1,6 @@
class A {
fun bar() = 1
}
fun foo(a: A) {
val x = a.val<caret>.bar()
}
@@ -0,0 +1,7 @@
class A {
fun bar() = 1
}
fun foo(a: A) {
val a1 = a
val x = a1.bar()
}
+6
View File
@@ -0,0 +1,6 @@
class A {
fun bar() = 1
}
fun foo(a: A) {
val x = a.bar().val<caret>
}
@@ -0,0 +1,7 @@
class A {
fun bar() = 1
}
fun foo(a: A) {
val bar = a.bar()
val x = bar
}