Data Inflow: Support grouping by expression nullability

This commit is contained in:
Alexey Sedunov
2017-11-10 19:28:52 +03:00
committed by Nikolay Krasko
parent 0a1580159f
commit c1cf03d89c
63 changed files with 668 additions and 4 deletions
@@ -133,6 +133,7 @@ import org.jetbrains.kotlin.idea.script.AbstractScriptConfigurationCompletionTes
import org.jetbrains.kotlin.idea.script.AbstractScriptConfigurationHighlightingTest
import org.jetbrains.kotlin.idea.script.AbstractScriptConfigurationNavigationTest
import org.jetbrains.kotlin.idea.slicer.AbstractSlicerLeafGroupingTest
import org.jetbrains.kotlin.idea.slicer.AbstractSlicerNullnessGroupingTest
import org.jetbrains.kotlin.idea.slicer.AbstractSlicerTreeTest
import org.jetbrains.kotlin.idea.structureView.AbstractKotlinFileStructureTest
import org.jetbrains.kotlin.idea.stubs.AbstractMultiFileHighlightingTest
@@ -727,6 +728,10 @@ fun main(args: Array<String>) {
testClass<AbstractSlicerLeafGroupingTest> {
model("slicer/inflow", singleClass = true)
}
testClass<AbstractSlicerNullnessGroupingTest> {
model("slicer/inflow", singleClass = true)
}
}
testGroup("idea/idea-maven/test", "idea/idea-maven/testData") {
@@ -16,15 +16,24 @@
package org.jetbrains.kotlin.idea.slicer
import com.intellij.codeInspection.dataFlow.Nullness
import com.intellij.ide.util.treeView.AbstractTreeStructure
import com.intellij.openapi.actionSystem.DefaultActionGroup
import com.intellij.psi.PsiElement
import com.intellij.slicer.*
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.idea.caches.resolve.analyzeAndGetResult
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptorIfAny
import org.jetbrains.kotlin.idea.quickfix.createFromUsage.callableBuilder.guessTypes
import org.jetbrains.kotlin.idea.references.KtReference
import org.jetbrains.kotlin.idea.references.mainReference
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.psiUtil.isPlainWithEscapes
import org.jetbrains.kotlin.psi.psiUtil.parentsWithSelf
import org.jetbrains.kotlin.types.TypeUtils
import org.jetbrains.kotlin.types.isError
import org.jetbrains.kotlin.types.isNullabilityFlexible
class KotlinSliceProvider : SliceLanguageSupportProvider {
companion object {
@@ -33,7 +42,32 @@ class KotlinSliceProvider : SliceLanguageSupportProvider {
}
}
class KotlinGroupByNullnessAction(treeBuilder: SliceTreeBuilder) : GroupByNullnessActionBase(treeBuilder) {
override fun isAvailable() = true
}
val leafAnalyzer by lazy { SliceLeafAnalyzer(LEAF_ELEMENT_EQUALITY, this) }
val nullnessAnalyzer: SliceNullnessAnalyzerBase by lazy {
object : SliceNullnessAnalyzerBase(LEAF_ELEMENT_EQUALITY, this) {
override fun checkNullness(element: PsiElement?): Nullness {
val types = when (element) {
is KtCallableDeclaration -> listOfNotNull((element.resolveToDescriptorIfAny() as? CallableDescriptor)?.returnType)
is KtDeclaration -> emptyList()
is KtExpression -> {
val (bindingContext, moduleDescriptor) = element.analyzeAndGetResult()
element.guessTypes(bindingContext, moduleDescriptor).toList()
}
else -> emptyList()
}
return when {
types.isEmpty() -> return Nullness.UNKNOWN
types.all { KotlinBuiltIns.isNullableNothing(it) } -> Nullness.NULLABLE
types.any { it.isError || TypeUtils.isNullableType(it) || it.isNullabilityFlexible() } -> Nullness.UNKNOWN
else -> Nullness.NOT_NULL
}
}
}
}
override fun createRootUsage(element: PsiElement, params: SliceAnalysisParams) = KotlinSliceUsage(element, params)
@@ -67,12 +101,13 @@ class KotlinSliceProvider : SliceLanguageSupportProvider {
}
override fun startAnalyzeNullness(structure: AbstractTreeStructure, finalRunnable: Runnable) {
nullnessAnalyzer.startAnalyzeNullness(structure, finalRunnable)
}
override fun registerExtraPanelActions(group: DefaultActionGroup, builder: SliceTreeBuilder) {
if (builder.dataFlowToThis) {
group.add(GroupByLeavesAction(builder))
group.add(KotlinGroupByNullnessAction(builder))
}
}
}
@@ -0,0 +1,3 @@
[NotNull Values]
8 val <bold>x = foo(fun(n: Int) = n)</bold>
8 val <bold>x = foo(fun(n: Int) = n)</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
8 val <bold>x = foo(fun(n: Int): Int { return n })</bold>
8 val <bold>x = foo(fun(n: Int): Int { return n })</bold>
+4
View File
@@ -0,0 +1,4 @@
[NotNull Values]
4 val <bold>x = o as String</bold>
4 val <bold>x = o as String</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
3 fun <bold>assignmentWithSum(n: Int): Int {</bold>
3 fun <bold>assignmentWithSum(n: Int): Int {</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
10 val x = <bold>foo</bold>
10 val x = <bold>foo</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
12 val <bold>x = foo</bold>
12 val <bold>x = foo</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
21 val <bold>y = b.foo()</bold>
21 val <bold>y = b.foo()</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
22 val <bold>z = c.foo()</bold>
22 val <bold>z = c.foo()</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
20 val <bold>x = a.foo()</bold>
20 val <bold>x = a.foo()</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
8 val <bold>x = foo(1, 2) { { it } }</bold>
8 val <bold>x = foo(1, 2) { { it } }</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
3 fun foo(<bold>n: Int</bold>, s: String = "???") {
3 fun foo(<bold>n: Int</bold>, s: String = "???") {
@@ -0,0 +1,3 @@
[NotNull Values]
3 fun foo(n: Int, <bold>s: String = "???"</bold>) {
3 fun foo(n: Int, <bold>s: String = "???"</bold>) {
@@ -0,0 +1,3 @@
[NotNull Values]
9 val <bold>x = foo(::bar)</bold>
9 val <bold>x = foo(::bar)</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
10 val <bold>x = foo(f)</bold>
10 val <bold>x = foo(f)</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
5 val <bold>x = (::bar)(1)</bold>
5 val <bold>x = (::bar)(1)</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
3 fun <bold>foo(n: Int) = n + 1</bold>
3 fun <bold>foo(n: Int) = n + 1</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
3 fun <bold>foo(n: Int): Int {</bold>
3 fun <bold>foo(n: Int): Int {</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
11 val x = <bold>foo</bold>
11 val x = <bold>foo</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
7 val <bold>x = foo</bold>
7 val <bold>x = foo</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
9 val <bold>x = foo</bold>
9 val <bold>x = foo</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
4 val <bold>x = if (m > 1) n else 1</bold>
4 val <bold>x = if (m > 1) n else 1</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
8 val <bold>x = foo { it }</bold>
8 val <bold>x = foo { it }</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
9 val <bold>y = foo { it }</bold>
9 val <bold>y = foo { it }</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
4 val <bold>x = { 1 }()</bold>
4 val <bold>x = { 1 }()</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
5 val <bold>x = f()</bold>
5 val <bold>x = f()</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
4 val <bold>x = n</bold>
4 val <bold>x = n</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
4 var <bold>x = n</bold>
4 var <bold>x = n</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
4 val <bold>x: Int = 1</bold>
4 val <bold>x: Int = 1</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
4 val <bold>x: Int</bold>
4 val <bold>x: Int</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
4 var <bold>x: Int = 1</bold>
4 var <bold>x: Int = 1</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
4 var <bold>x: Int</bold>
4 var <bold>x: Int</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
11 val x = <bold>foo</bold>
11 val x = <bold>foo</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
5 fun <bold>bar(a: Int): Int = foo(a) { if (it > 0) it else return 0 }</bold>
5 fun <bold>bar(a: Int): Int = foo(a) { if (it > 0) it else return 0 }</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
4 val <bold>x = s!!</bold>
4 val <bold>x = s!!</bold>
+10
View File
@@ -0,0 +1,10 @@
// FLOW: IN
fun test(n: Int): String {
var s = when {
n > 0 -> "+"
n < 0 -> "-"
else -> null
}
return <caret>s
}
@@ -0,0 +1,17 @@
7 else -> <bold>null</bold>
9 return <bold>s</bold>
4 var <bold>s = when {</bold>
4 var s = <bold>when {</bold>
7 else -> <bold>null</bold>
6 n < 0 -> <bold>"-"</bold>
9 return <bold>s</bold>
4 var <bold>s = when {</bold>
4 var s = <bold>when {</bold>
6 n < 0 -> <bold>"-"</bold>
5 n > 0 -> <bold>"+"</bold>
9 return <bold>s</bold>
4 var <bold>s = when {</bold>
4 var s = <bold>when {</bold>
5 n > 0 -> <bold>"+"</bold>
@@ -0,0 +1,18 @@
[Null Values]
7 else -> <bold>null</bold>
9 return <bold>s</bold>
4 var <bold>s = when {</bold>
4 var s = <bold>when {</bold>
7 else -> <bold>null</bold>
[NotNull Values]
6 n < 0 -> <bold>"-"</bold>
9 return <bold>s</bold>
4 var <bold>s = when {</bold>
4 var s = <bold>when {</bold>
6 n < 0 -> <bold>"-"</bold>
5 n > 0 -> <bold>"+"</bold>
9 return <bold>s</bold>
4 var <bold>s = when {</bold>
4 var s = <bold>when {</bold>
5 n > 0 -> <bold>"+"</bold>
@@ -0,0 +1,6 @@
9 return <bold>s</bold>
4 var <bold>s = when {</bold>
4 var s = <bold>when {</bold>
5 n > 0 -> <bold>"+"</bold>
6 n < 0 -> <bold>"-"</bold>
7 else -> <bold>null</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
17 val <bold>y = b.foo()</bold>
17 val <bold>y = b.foo()</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
15 val <bold>y = b.foo</bold>
15 val <bold>y = b.foo</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
20 val <bold>y = b.foo</bold>
20 val <bold>y = b.foo</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
17 val <bold>y = b.foo</bold>
17 val <bold>y = b.foo</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
3 open class A(<bold>n: Int</bold>, s: String = "???")
3 open class A(<bold>n: Int</bold>, s: String = "???")
@@ -0,0 +1,3 @@
[NotNull Values]
3 open class A(n: Int, <bold>s: String = "???"</bold>)
3 open class A(n: Int, <bold>s: String = "???"</bold>)
@@ -0,0 +1,3 @@
[NotNull Values]
15 println("Now my name is '${a.<bold>name</bold>}'")
15 println("Now my name is '${a.<bold>name</bold>}'")
@@ -0,0 +1,3 @@
[NotNull Values]
8 println("And now my name is '$<bold>name</bold>'")
8 println("And now my name is '$<bold>name</bold>'")
@@ -0,0 +1,6 @@
[NotNull Values]
4 val x = <bold>o</bold> as? String
4 val <bold>x = o as? String</bold>
4 val x = <bold>o as? String</bold>
4 val x = <bold>o</bold> as? String
@@ -0,0 +1,3 @@
[NotNull Values]
4 constructor(<bold>n: Int</bold>, s: String = "???")
4 constructor(<bold>n: Int</bold>, s: String = "???")
@@ -0,0 +1,3 @@
[NotNull Values]
4 constructor(n: Int, <bold>s: String = "???"</bold>)
4 constructor(n: Int, <bold>s: String = "???"</bold>)
@@ -0,0 +1,3 @@
[NotNull Values]
25 println("My name is '${a.<bold>name</bold>}'")
25 println("My name is '${a.<bold>name</bold>}'")
@@ -0,0 +1,3 @@
[NotNull Values]
19 println("Now my name is '$<bold>name</bold>'")
19 println("Now my name is '$<bold>name</bold>'")
@@ -0,0 +1,3 @@
[NotNull Values]
3 val <bold>foo: Int = 1</bold>
3 val <bold>foo: Int = 1</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
3 var <bold>foo: Int = 1</bold>
3 var <bold>foo: Int = 1</bold>
@@ -0,0 +1,3 @@
[NotNull Values]
3 open class A(val <bold>n: Int</bold>)
3 open class A(val <bold>n: Int</bold>)
@@ -0,0 +1,3 @@
[NotNull Values]
3 open class A(var <bold>n: Int</bold>) {
3 open class A(var <bold>n: Int</bold>) {
@@ -0,0 +1,3 @@
[NotNull Values]
4 val <bold>x = when (m) {</bold>
4 val <bold>x = when (m) {</bold>
@@ -0,0 +1,39 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.idea.slicer
import com.intellij.slicer.SliceNullnessAnalyzerBase
import com.intellij.slicer.SliceRootNode
import org.jetbrains.kotlin.test.KotlinTestUtils
import java.io.File
abstract class AbstractSlicerNullnessGroupingTest : AbstractSlicerTest() {
override fun doTest(path: String, sliceProvider: KotlinSliceProvider, rootNode: SliceRootNode) {
val treeStructure = SliceTreeStructure(rootNode)
val analyzer = sliceProvider.nullnessAnalyzer
val nullnessByNode = SliceNullnessAnalyzerBase.createMap()
val nullness = analyzer.calcNullableLeaves(rootNode, treeStructure, nullnessByNode)
val newRootNode = analyzer.createNewTree(nullness, rootNode, nullnessByNode)
val renderedForest = buildString {
for (groupRootNode in newRootNode.children) {
append(buildTreeRepresentation(groupRootNode))
append("\n")
}
}
KotlinTestUtils.assertEqualsToFile(File(path.replace(".kt", ".nullnessGroups.txt")), renderedForest)
}
}
@@ -56,11 +56,13 @@ abstract class AbstractSlicerTest : KotlinLightCodeInsightFixtureTestCase() {
return text
}
fun SliceNode.isSliceLeafValueClassNode() = javaClass.name == "com.intellij.slicer.SliceLeafValueClassNode"
fun process(node: SliceNode, indent: Int): String {
val usage = node.element!!.value as KotlinSliceUsage
val usage = node.element!!.value
node.calculateDupNode()
val isDuplicated = node.duplicate != null
val isDuplicated = !node.isSliceLeafValueClassNode() && node.duplicate != null
return buildString {
when {
@@ -68,6 +70,8 @@ abstract class AbstractSlicerTest : KotlinLightCodeInsightFixtureTestCase() {
node.children.forEach { append(process(it, indent)) }
return@buildString
}
// SliceLeafValueClassNode is package-private
node.isSliceLeafValueClassNode() -> append("[${node.nodeText}]\n")
else -> {
val chunks = usage.text
append(chunks.first().render() + " ")
@@ -75,7 +79,9 @@ abstract class AbstractSlicerTest : KotlinLightCodeInsightFixtureTestCase() {
if (usage is KotlinSliceDereferenceUsage) {
append("DEREFERENCE: ")
}
append("[LAMBDA] ".repeat(usage.lambdaLevel))
if (usage is KotlinSliceUsage) {
append("[LAMBDA] ".repeat(usage.lambdaLevel))
}
chunks.slice(1..chunks.size - 1).joinTo(
this,
separator = "",
@@ -240,6 +240,12 @@ public class SlicerLeafGroupingTestGenerated extends AbstractSlicerLeafGroupingT
doTest(fileName);
}
@TestMetadata("nullsAndNotNulls.kt")
public void testInflow_NullsAndNotNulls() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/nullsAndNotNulls.kt");
doTest(fileName);
}
@TestMetadata("overridingFunctionResult.kt")
public void testInflow_OverridingFunctionResult() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/overridingFunctionResult.kt");
@@ -0,0 +1,356 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.idea.slicer;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
import org.jetbrains.kotlin.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.TargetBackend;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.runner.RunWith;
import java.io.File;
import java.util.regex.Pattern;
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("idea/testData/slicer/inflow")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public class SlicerNullnessGroupingTestGenerated extends AbstractSlicerNullnessGroupingTest {
public void testAllFilesPresentInSlicer() throws Exception {
KotlinTestUtils.assertAllTestsPresentInSingleGeneratedClass(this.getClass(), new File("idea/testData/slicer/inflow"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY);
}
@TestMetadata("anonymousFunBodyExpression.kt")
public void testInflow_AnonymousFunBodyExpression() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/anonymousFunBodyExpression.kt");
doTest(fileName);
}
@TestMetadata("anonymousFunReturnExpression.kt")
public void testInflow_AnonymousFunReturnExpression() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/anonymousFunReturnExpression.kt");
doTest(fileName);
}
@TestMetadata("cast.kt")
public void testInflow_Cast() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/cast.kt");
doTest(fileName);
}
@TestMetadata("compositeAssignments.kt")
public void testInflow_CompositeAssignments() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/compositeAssignments.kt");
doTest(fileName);
}
@TestMetadata("defaultGetterFieldInSetter.kt")
public void testInflow_DefaultGetterFieldInSetter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/defaultGetterFieldInSetter.kt");
doTest(fileName);
}
@TestMetadata("delegateGetter.kt")
public void testInflow_DelegateGetter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/delegateGetter.kt");
doTest(fileName);
}
@TestMetadata("diamondHierarchyMiddleClassFun.kt")
public void testInflow_DiamondHierarchyMiddleClassFun() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/diamondHierarchyMiddleClassFun.kt");
doTest(fileName);
}
@TestMetadata("diamondHierarchyMiddleInterfaceFun.kt")
public void testInflow_DiamondHierarchyMiddleInterfaceFun() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/diamondHierarchyMiddleInterfaceFun.kt");
doTest(fileName);
}
@TestMetadata("diamondHierarchyRootInterfaceFun.kt")
public void testInflow_DiamondHierarchyRootInterfaceFun() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/diamondHierarchyRootInterfaceFun.kt");
doTest(fileName);
}
@TestMetadata("doubleLambdaResult.kt")
public void testInflow_DoubleLambdaResult() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/doubleLambdaResult.kt");
doTest(fileName);
}
@TestMetadata("funParamerer.kt")
public void testInflow_FunParamerer() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funParamerer.kt");
doTest(fileName);
}
@TestMetadata("funParamererWithDefault.kt")
public void testInflow_FunParamererWithDefault() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funParamererWithDefault.kt");
doTest(fileName);
}
@TestMetadata("funResultViaCallableRef.kt")
public void testInflow_FunResultViaCallableRef() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funResultViaCallableRef.kt");
doTest(fileName);
}
@TestMetadata("funResultViaCallableRefWithAssignment.kt")
public void testInflow_FunResultViaCallableRefWithAssignment() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funResultViaCallableRefWithAssignment.kt");
doTest(fileName);
}
@TestMetadata("funResultViaCallableRefWithDirectCall.kt")
public void testInflow_FunResultViaCallableRefWithDirectCall() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funResultViaCallableRefWithDirectCall.kt");
doTest(fileName);
}
@TestMetadata("funWithExpressionBody.kt")
public void testInflow_FunWithExpressionBody() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funWithExpressionBody.kt");
doTest(fileName);
}
@TestMetadata("funWithReturnExpressions.kt")
public void testInflow_FunWithReturnExpressions() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funWithReturnExpressions.kt");
doTest(fileName);
}
@TestMetadata("getterAndSetterUsingField.kt")
public void testInflow_GetterAndSetterUsingField() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/getterAndSetterUsingField.kt");
doTest(fileName);
}
@TestMetadata("getterExpressionBody.kt")
public void testInflow_GetterExpressionBody() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/getterExpressionBody.kt");
doTest(fileName);
}
@TestMetadata("getterReturnExpression.kt")
public void testInflow_GetterReturnExpression() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/getterReturnExpression.kt");
doTest(fileName);
}
@TestMetadata("ifExpression.kt")
public void testInflow_IfExpression() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/ifExpression.kt");
doTest(fileName);
}
@TestMetadata("lambdaResult.kt")
public void testInflow_LambdaResult() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/lambdaResult.kt");
doTest(fileName);
}
@TestMetadata("lambdaResultWithAssignments.kt")
public void testInflow_LambdaResultWithAssignments() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/lambdaResultWithAssignments.kt");
doTest(fileName);
}
@TestMetadata("lambdaResultWithDirectCall.kt")
public void testInflow_LambdaResultWithDirectCall() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/lambdaResultWithDirectCall.kt");
doTest(fileName);
}
@TestMetadata("lambdaResultWithDirectCallViaAssignment.kt")
public void testInflow_LambdaResultWithDirectCallViaAssignment() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/lambdaResultWithDirectCallViaAssignment.kt");
doTest(fileName);
}
@TestMetadata("localVal.kt")
public void testInflow_LocalVal() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/localVal.kt");
doTest(fileName);
}
@TestMetadata("localVar.kt")
public void testInflow_LocalVar() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/localVar.kt");
doTest(fileName);
}
@TestMetadata("memberValWithInitializer.kt")
public void testInflow_MemberValWithInitializer() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/memberValWithInitializer.kt");
doTest(fileName);
}
@TestMetadata("memberValWithSplitInitializer.kt")
public void testInflow_MemberValWithSplitInitializer() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/memberValWithSplitInitializer.kt");
doTest(fileName);
}
@TestMetadata("memberVarWithInitializer.kt")
public void testInflow_MemberVarWithInitializer() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/memberVarWithInitializer.kt");
doTest(fileName);
}
@TestMetadata("memberVarWithSplitInitializer.kt")
public void testInflow_MemberVarWithSplitInitializer() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/memberVarWithSplitInitializer.kt");
doTest(fileName);
}
@TestMetadata("noFieldInGetter.kt")
public void testInflow_NoFieldInGetter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/noFieldInGetter.kt");
doTest(fileName);
}
@TestMetadata("nonLocalReturn.kt")
public void testInflow_NonLocalReturn() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/nonLocalReturn.kt");
doTest(fileName);
}
@TestMetadata("notNullAssertion.kt")
public void testInflow_NotNullAssertion() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/notNullAssertion.kt");
doTest(fileName);
}
@TestMetadata("nullsAndNotNulls.kt")
public void testInflow_NullsAndNotNulls() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/nullsAndNotNulls.kt");
doTest(fileName);
}
@TestMetadata("overridingFunctionResult.kt")
public void testInflow_OverridingFunctionResult() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/overridingFunctionResult.kt");
doTest(fileName);
}
@TestMetadata("overridingParameter.kt")
public void testInflow_OverridingParameter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/overridingParameter.kt");
doTest(fileName);
}
@TestMetadata("overridingPropertyGetterResult.kt")
public void testInflow_OverridingPropertyGetterResult() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/overridingPropertyGetterResult.kt");
doTest(fileName);
}
@TestMetadata("overridingPropertyResult.kt")
public void testInflow_OverridingPropertyResult() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/overridingPropertyResult.kt");
doTest(fileName);
}
@TestMetadata("primaryConstructorParameter.kt")
public void testInflow_PrimaryConstructorParameter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/primaryConstructorParameter.kt");
doTest(fileName);
}
@TestMetadata("primaryConstructorParameterWithDefault.kt")
public void testInflow_PrimaryConstructorParameterWithDefault() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.kt");
doTest(fileName);
}
@TestMetadata("qualifiedAssignmentsForQualifiedRef.kt")
public void testInflow_QualifiedAssignmentsForQualifiedRef() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.kt");
doTest(fileName);
}
@TestMetadata("qualifiedAssignmentsForSimpleRef.kt")
public void testInflow_QualifiedAssignmentsForSimpleRef() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.kt");
doTest(fileName);
}
@TestMetadata("safeCast.kt")
public void testInflow_SafeCast() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/safeCast.kt");
doTest(fileName);
}
@TestMetadata("secondaryConstructorParameter.kt")
public void testInflow_SecondaryConstructorParameter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/secondaryConstructorParameter.kt");
doTest(fileName);
}
@TestMetadata("secondaryConstructorParameterWithDefault.kt")
public void testInflow_SecondaryConstructorParameterWithDefault() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.kt");
doTest(fileName);
}
@TestMetadata("settersViaDelegateForQualifiedRef.kt")
public void testInflow_SettersViaDelegateForQualifiedRef() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.kt");
doTest(fileName);
}
@TestMetadata("settersViaDelegateForSimpleRef.kt")
public void testInflow_SettersViaDelegateForSimpleRef() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.kt");
doTest(fileName);
}
@TestMetadata("topLevelVal.kt")
public void testInflow_TopLevelVal() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/topLevelVal.kt");
doTest(fileName);
}
@TestMetadata("topLevelVar.kt")
public void testInflow_TopLevelVar() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/topLevelVar.kt");
doTest(fileName);
}
@TestMetadata("valParameter.kt")
public void testInflow_ValParameter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/valParameter.kt");
doTest(fileName);
}
@TestMetadata("varParameter.kt")
public void testInflow_VarParameter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/varParameter.kt");
doTest(fileName);
}
@TestMetadata("whenExpression.kt")
public void testInflow_WhenExpression() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/whenExpression.kt");
doTest(fileName);
}
}
@@ -229,6 +229,12 @@ public class SlicerTreeTestGenerated extends AbstractSlicerTreeTest {
doTest(fileName);
}
@TestMetadata("inflow/nullsAndNotNulls.kt")
public void testInflow_NullsAndNotNulls() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/nullsAndNotNulls.kt");
doTest(fileName);
}
@TestMetadata("inflow/overridingFunctionResult.kt")
public void testInflow_OverridingFunctionResult() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/overridingFunctionResult.kt");