Refine default postfix templates selector
There is new settings checkCanBeUsedAsValue Also expression filtering are split into to parts: - getNonFilteredExpressions is trivially goes until it reaches first block body of some declarations - all additional filtering is merged into Condition that is passed into PostfixTemplateExpressionSelectorBase super-call Notable changes for users: - do not suggest try for non-top-level expressions - do not suggest var/par/etc for loops
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
fun foo(x: Boolean) {
|
||||
foo(x.assert<caret>)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun foo(x: Boolean) {
|
||||
foo(x.assert <caret>)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
for (i in 1..100) {
|
||||
|
||||
}.par<caret>
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
for (i in 1..100) {
|
||||
|
||||
}.par <caret>
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
fun foo() {
|
||||
for (i in 1..100) {
|
||||
}.try<caret>
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
try {
|
||||
for (i in 1..100) {
|
||||
}
|
||||
} catch(e: Exception) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun foo() {
|
||||
val x = 1.try<caret>
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fun foo() {
|
||||
try {
|
||||
val x = 1
|
||||
} catch(e: Exception) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user