diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index fd4bb886ab6..0176b5ba0c2 100644 --- a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -662,7 +662,8 @@ fun main(args: Array) { } testClass(javaClass()) { - model("debugger/selectExpression") + model("debugger/selectExpression", recursive = false) + model("debugger/selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") } testClass(javaClass()) { diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinEditorTextProvider.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinEditorTextProvider.kt index ff4ab6df90f..b4a2c192466 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinEditorTextProvider.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinEditorTextProvider.kt @@ -37,21 +37,23 @@ import org.jetbrains.kotlin.psi.JetCodeFragment import org.jetbrains.kotlin.psi.JetUserType import org.jetbrains.kotlin.psi.JetImportDirective import org.jetbrains.kotlin.psi.JetPackageDirective +import org.jetbrains.kotlin.psi.JetCallExpression +import org.jetbrains.kotlin.psi.JetArrayAccessExpression class KotlinEditorTextProvider : EditorTextProvider { override fun getEditorText(elementAtCaret: PsiElement): TextWithImports? { - val expression = findExpressionInner(elementAtCaret) + val expression = findExpressionInner(elementAtCaret, true) return TextWithImportsImpl(CodeFragmentKind.EXPRESSION, expression?.getText() ?: "", JetCodeFragment.getImportsForElement(elementAtCaret), JetFileType.INSTANCE) } override fun findExpression(elementAtCaret: PsiElement, allowMethodCalls: Boolean): Pair? { - val expression = findExpressionInner(elementAtCaret) + val expression = findExpressionInner(elementAtCaret, allowMethodCalls) if (expression == null) return null return Pair(expression, expression.getTextRange()) } class object { - fun findExpressionInner(element: PsiElement): JetExpression? { + fun findExpressionInner(element: PsiElement, allowMethodCalls: Boolean): JetExpression? { if (PsiTreeUtil.getParentOfType(element, javaClass(), javaClass(), javaClass()) != null) { return null } @@ -89,6 +91,15 @@ class KotlinEditorTextProvider : EditorTextProvider { else -> null } + if (!allowMethodCalls && newExpression != null) { + fun PsiElement.isCall() = this is JetCallExpression || this is JetOperationExpression || this is JetArrayAccessExpression + + if (newExpression.isCall() || + newExpression is JetQualifiedExpression && newExpression.getSelectorExpression().isCall()) { + return null + } + } + return when { newExpression is JetExpression -> newExpression jetElement is JetSimpleNameExpression -> jetElement diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinCodeFragmentFactory.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinCodeFragmentFactory.kt index a4adcaa8c8f..82b362eacbd 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinCodeFragmentFactory.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinCodeFragmentFactory.kt @@ -112,7 +112,7 @@ class KotlinCodeFragmentFactory: CodeFragmentFactory() { if (expressionAtOffset != null) { return expressionAtOffset } - return KotlinEditorTextProvider.findExpressionInner(elementAt) + return KotlinEditorTextProvider.findExpressionInner(elementAt, true) } } } diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/binaryExpression.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/binaryExpression.kt new file mode 100644 index 00000000000..b04c2f4bccd --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/binaryExpression.kt @@ -0,0 +1,5 @@ +fun foo() { + 1 + 1 +} + +// EXPECTED: null \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/call.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/call.kt new file mode 100644 index 00000000000..f982c9dc1ac --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/call.kt @@ -0,0 +1,7 @@ +fun foo() { + bar() +} + +fun bar() = 1 + +// EXPECTED: null \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/expressionInPropertyInitializer.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/expressionInPropertyInitializer.kt new file mode 100644 index 00000000000..cd00eb1eb20 --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/expressionInPropertyInitializer.kt @@ -0,0 +1,4 @@ +val a = 1 +val b = a + +// EXPECTED: a \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/extensionFun.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/extensionFun.kt new file mode 100644 index 00000000000..2457b46df85 --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/extensionFun.kt @@ -0,0 +1,7 @@ +fun foo() { + 1.foo() +} + +fun Int.foo() = 1 + +// EXPECTED: null \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/funArgument.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/funArgument.kt new file mode 100644 index 00000000000..c2dffb9e9df --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/funArgument.kt @@ -0,0 +1,8 @@ +fun foo() { + val a = 1 + bar(a) +} + +fun bar(i: Int) = 1 + +// EXPECTED: a \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/functionLiteral.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/functionLiteral.kt new file mode 100644 index 00000000000..aaf42bef62c --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/functionLiteral.kt @@ -0,0 +1,7 @@ +fun foo() { + bar { } +} + +fun bar(f: () -> Unit) = 1 + +// EXPECTED: null \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/getConvention.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/getConvention.kt new file mode 100644 index 00000000000..7f045bf850e --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/getConvention.kt @@ -0,0 +1,10 @@ +fun foo() { + val klass = MyClass() + klass[1] +} + +class MyClass { + fun get(i: Int): Int = 1 +} + +// EXPECTED: null \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/infixCall.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/infixCall.kt new file mode 100644 index 00000000000..7a1c0b311ff --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/infixCall.kt @@ -0,0 +1,7 @@ +fun foo() { + 1 foo 1 +} + +fun Int.foo(i: Int) = 1 + +// EXPECTED: null \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/infixCallArgument.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/infixCallArgument.kt new file mode 100644 index 00000000000..4765fc9ecb3 --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/infixCallArgument.kt @@ -0,0 +1,8 @@ +fun foo() { + val a = 1 + a foo 1 +} + +fun Int.foo(i: Int) = 1 + +// EXPECTED: a \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/isExpression.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/isExpression.kt new file mode 100644 index 00000000000..66e1ea72daf --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/isExpression.kt @@ -0,0 +1,5 @@ +fun foo() { + 1 is Int +} + +// EXPECTED: null \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/propertyCall.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/propertyCall.kt new file mode 100644 index 00000000000..1c8edc12457 --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/propertyCall.kt @@ -0,0 +1,6 @@ +val a = 1 +fun foo() { + a +} + +// EXPECTED: a \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/qualifiedExpressionProperty.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/qualifiedExpressionProperty.kt new file mode 100644 index 00000000000..1daa4b068c4 --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/qualifiedExpressionProperty.kt @@ -0,0 +1,10 @@ +fun foo() { + val klass = MyClass() + klass.bar +} + +class MyClass { + val bar = 1 +} + +// EXPECTED: klass.bar \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/qualifiedExpressionReceiver.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/qualifiedExpressionReceiver.kt new file mode 100644 index 00000000000..b18929780d2 --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/qualifiedExpressionReceiver.kt @@ -0,0 +1,10 @@ +fun foo() { + val klass = MyClass() + klass.bar() +} + +class MyClass { + fun bar() = 1 +} + +// EXPECTED: klass \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/qualifiedExpressionSelector.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/qualifiedExpressionSelector.kt new file mode 100644 index 00000000000..67b1ec450a6 --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/qualifiedExpressionSelector.kt @@ -0,0 +1,10 @@ +fun foo() { + val klass = MyClass() + klass.bar() +} + +class MyClass { + fun bar() = 1 +} + +// EXPECTED: null \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/super.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/super.kt new file mode 100644 index 00000000000..aaa931763cd --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/super.kt @@ -0,0 +1,11 @@ +class Derived: Base() { + fun test() { + super.test() + } +} + +open class Base { + fun test() {} +} + +// EXPECTED: null \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/this.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/this.kt new file mode 100644 index 00000000000..212e9643e6b --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/this.kt @@ -0,0 +1,7 @@ +class MyClass { + fun test() { + this.test() + } +} + +// EXPECTED: null \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/thisWithLabel.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/thisWithLabel.kt new file mode 100644 index 00000000000..62ca3ae9bd2 --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/thisWithLabel.kt @@ -0,0 +1,7 @@ +class MyClass { + fun Int.test() { + this@MyClass + } +} + +// EXPECTED: this@MyClass \ No newline at end of file diff --git a/idea/testData/debugger/selectExpression/disallowMethodCalls/unaryExpression.kt b/idea/testData/debugger/selectExpression/disallowMethodCalls/unaryExpression.kt new file mode 100644 index 00000000000..4ccc5851286 --- /dev/null +++ b/idea/testData/debugger/selectExpression/disallowMethodCalls/unaryExpression.kt @@ -0,0 +1,5 @@ +fun foo() { + +1 +} + +// EXPECTED: null \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractSelectExpressionForDebuggerTest.kt b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractSelectExpressionForDebuggerTest.kt index 0c3eab00532..4cccd4ce61a 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractSelectExpressionForDebuggerTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractSelectExpressionForDebuggerTest.kt @@ -25,10 +25,18 @@ import org.junit.Assert public abstract class AbstractSelectExpressionForDebuggerTest : LightCodeInsightFixtureTestCase() { fun doTest(path: String) { + doTest(path, true) + } + + fun doTestWoMethodCalls(path: String) { + doTest(path, false) + } + + fun doTest(path: String, allowMethodCalls: Boolean) { myFixture.configureByFile(path) val elementAt = myFixture.getFile()?.findElementAt(myFixture.getCaretOffset())!! - val selectedExpression = KotlinEditorTextProvider.findExpressionInner(elementAt) + val selectedExpression = KotlinEditorTextProvider.findExpressionInner(elementAt, allowMethodCalls) val expected = InTextDirectivesUtils.findStringWithPrefixes(myFixture.getFile()?.getText()!!, "// EXPECTED: ") Assert.assertEquals("Another expression should be selected", expected, selectedExpression?.getText() ?: "null") diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/SelectExpressionForDebuggerTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/SelectExpressionForDebuggerTestGenerated.java index 591ba38bd51..1f8ded896cd 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/SelectExpressionForDebuggerTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/SelectExpressionForDebuggerTestGenerated.java @@ -28,179 +28,300 @@ 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/debugger/selectExpression") -@TestDataPath("$PROJECT_ROOT") +@InnerTestClasses({SelectExpressionForDebuggerTestGenerated.SelectExpression.class, SelectExpressionForDebuggerTestGenerated.DisallowMethodCalls.class}) @RunWith(JUnit3RunnerWithInners.class) public class SelectExpressionForDebuggerTestGenerated extends AbstractSelectExpressionForDebuggerTest { - public void testAllFilesPresentInSelectExpression() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/selectExpression"), Pattern.compile("^(.+)\\.kt$"), true); + @TestMetadata("idea/testData/debugger/selectExpression") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class SelectExpression extends AbstractSelectExpressionForDebuggerTest { + public void testAllFilesPresentInSelectExpression() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/selectExpression"), Pattern.compile("^(.+)\\.kt$"), false); + } + + @TestMetadata("annotation.kt") + public void testAnnotation() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/annotation.kt"); + doTest(fileName); + } + + @TestMetadata("binaryExpression.kt") + public void testBinaryExpression() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/binaryExpression.kt"); + doTest(fileName); + } + + @TestMetadata("call.kt") + public void testCall() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/call.kt"); + doTest(fileName); + } + + @TestMetadata("expressionInPropertyInitializer.kt") + public void testExpressionInPropertyInitializer() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/expressionInPropertyInitializer.kt"); + doTest(fileName); + } + + @TestMetadata("extensionFun.kt") + public void testExtensionFun() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/extensionFun.kt"); + doTest(fileName); + } + + @TestMetadata("funArgument.kt") + public void testFunArgument() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/funArgument.kt"); + doTest(fileName); + } + + @TestMetadata("functionLiteral.kt") + public void testFunctionLiteral() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/functionLiteral.kt"); + doTest(fileName); + } + + @TestMetadata("getConvention.kt") + public void testGetConvention() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/getConvention.kt"); + doTest(fileName); + } + + @TestMetadata("imports.kt") + public void testImports() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/imports.kt"); + doTest(fileName); + } + + @TestMetadata("infixCall.kt") + public void testInfixCall() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/infixCall.kt"); + doTest(fileName); + } + + @TestMetadata("infixCallArgument.kt") + public void testInfixCallArgument() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/infixCallArgument.kt"); + doTest(fileName); + } + + @TestMetadata("isExpression.kt") + public void testIsExpression() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/isExpression.kt"); + doTest(fileName); + } + + @TestMetadata("keyword.kt") + public void testKeyword() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/keyword.kt"); + doTest(fileName); + } + + @TestMetadata("modifier.kt") + public void testModifier() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/modifier.kt"); + doTest(fileName); + } + + @TestMetadata("package.kt") + public void testPackage() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/package.kt"); + doTest(fileName); + } + + @TestMetadata("param.kt") + public void testParam() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/param.kt"); + doTest(fileName); + } + + @TestMetadata("propertyCall.kt") + public void testPropertyCall() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/propertyCall.kt"); + doTest(fileName); + } + + @TestMetadata("propertyDeclaration.kt") + public void testPropertyDeclaration() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/propertyDeclaration.kt"); + doTest(fileName); + } + + @TestMetadata("qualifiedExpressionProperty.kt") + public void testQualifiedExpressionProperty() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/qualifiedExpressionProperty.kt"); + doTest(fileName); + } + + @TestMetadata("qualifiedExpressionReceiver.kt") + public void testQualifiedExpressionReceiver() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/qualifiedExpressionReceiver.kt"); + doTest(fileName); + } + + @TestMetadata("qualifiedExpressionSelector.kt") + public void testQualifiedExpressionSelector() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/qualifiedExpressionSelector.kt"); + doTest(fileName); + } + + @TestMetadata("super.kt") + public void testSuper() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/super.kt"); + doTest(fileName); + } + + @TestMetadata("this.kt") + public void testThis() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/this.kt"); + doTest(fileName); + } + + @TestMetadata("thisWithLabel.kt") + public void testThisWithLabel() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/thisWithLabel.kt"); + doTest(fileName); + } + + @TestMetadata("unaryExpression.kt") + public void testUnaryExpression() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/unaryExpression.kt"); + doTest(fileName); + } + + @TestMetadata("userType.kt") + public void testUserType() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/userType.kt"); + doTest(fileName); + } + + @TestMetadata("userTypeGeneric.kt") + public void testUserTypeGeneric() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/userTypeGeneric.kt"); + doTest(fileName); + } + + @TestMetadata("userTypeQualified.kt") + public void testUserTypeQualified() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/userTypeQualified.kt"); + doTest(fileName); + } } - @TestMetadata("annotation.kt") - public void testAnnotation() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/annotation.kt"); - doTest(fileName); - } + @TestMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DisallowMethodCalls extends AbstractSelectExpressionForDebuggerTest { + public void testAllFilesPresentInDisallowMethodCalls() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/selectExpression/disallowMethodCalls"), Pattern.compile("^(.+)\\.kt$"), true); + } - @TestMetadata("binaryExpression.kt") - public void testBinaryExpression() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/binaryExpression.kt"); - doTest(fileName); - } + @TestMetadata("binaryExpression.kt") + public void testBinaryExpression() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/binaryExpression.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("call.kt") - public void testCall() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/call.kt"); - doTest(fileName); - } + @TestMetadata("call.kt") + public void testCall() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/call.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("expressionInPropertyInitializer.kt") - public void testExpressionInPropertyInitializer() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/expressionInPropertyInitializer.kt"); - doTest(fileName); - } + @TestMetadata("expressionInPropertyInitializer.kt") + public void testExpressionInPropertyInitializer() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/expressionInPropertyInitializer.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("extensionFun.kt") - public void testExtensionFun() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/extensionFun.kt"); - doTest(fileName); - } + @TestMetadata("extensionFun.kt") + public void testExtensionFun() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/extensionFun.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("funArgument.kt") - public void testFunArgument() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/funArgument.kt"); - doTest(fileName); - } + @TestMetadata("funArgument.kt") + public void testFunArgument() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/funArgument.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("functionLiteral.kt") - public void testFunctionLiteral() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/functionLiteral.kt"); - doTest(fileName); - } + @TestMetadata("functionLiteral.kt") + public void testFunctionLiteral() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/functionLiteral.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("getConvention.kt") - public void testGetConvention() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/getConvention.kt"); - doTest(fileName); - } + @TestMetadata("getConvention.kt") + public void testGetConvention() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/getConvention.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("imports.kt") - public void testImports() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/imports.kt"); - doTest(fileName); - } + @TestMetadata("infixCall.kt") + public void testInfixCall() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/infixCall.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("infixCall.kt") - public void testInfixCall() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/infixCall.kt"); - doTest(fileName); - } + @TestMetadata("infixCallArgument.kt") + public void testInfixCallArgument() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/infixCallArgument.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("infixCallArgument.kt") - public void testInfixCallArgument() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/infixCallArgument.kt"); - doTest(fileName); - } + @TestMetadata("isExpression.kt") + public void testIsExpression() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/isExpression.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("isExpression.kt") - public void testIsExpression() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/isExpression.kt"); - doTest(fileName); - } + @TestMetadata("propertyCall.kt") + public void testPropertyCall() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/propertyCall.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("keyword.kt") - public void testKeyword() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/keyword.kt"); - doTest(fileName); - } + @TestMetadata("qualifiedExpressionProperty.kt") + public void testQualifiedExpressionProperty() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/qualifiedExpressionProperty.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("modifier.kt") - public void testModifier() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/modifier.kt"); - doTest(fileName); - } + @TestMetadata("qualifiedExpressionReceiver.kt") + public void testQualifiedExpressionReceiver() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/qualifiedExpressionReceiver.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("package.kt") - public void testPackage() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/package.kt"); - doTest(fileName); - } + @TestMetadata("qualifiedExpressionSelector.kt") + public void testQualifiedExpressionSelector() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/qualifiedExpressionSelector.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("param.kt") - public void testParam() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/param.kt"); - doTest(fileName); - } + @TestMetadata("super.kt") + public void testSuper() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/super.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("propertyCall.kt") - public void testPropertyCall() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/propertyCall.kt"); - doTest(fileName); - } + @TestMetadata("this.kt") + public void testThis() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/this.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("propertyDeclaration.kt") - public void testPropertyDeclaration() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/propertyDeclaration.kt"); - doTest(fileName); - } + @TestMetadata("thisWithLabel.kt") + public void testThisWithLabel() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/thisWithLabel.kt"); + doTestWoMethodCalls(fileName); + } - @TestMetadata("qualifiedExpressionProperty.kt") - public void testQualifiedExpressionProperty() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/qualifiedExpressionProperty.kt"); - doTest(fileName); - } - - @TestMetadata("qualifiedExpressionReceiver.kt") - public void testQualifiedExpressionReceiver() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/qualifiedExpressionReceiver.kt"); - doTest(fileName); - } - - @TestMetadata("qualifiedExpressionSelector.kt") - public void testQualifiedExpressionSelector() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/qualifiedExpressionSelector.kt"); - doTest(fileName); - } - - @TestMetadata("super.kt") - public void testSuper() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/super.kt"); - doTest(fileName); - } - - @TestMetadata("this.kt") - public void testThis() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/this.kt"); - doTest(fileName); - } - - @TestMetadata("thisWithLabel.kt") - public void testThisWithLabel() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/thisWithLabel.kt"); - doTest(fileName); - } - - @TestMetadata("unaryExpression.kt") - public void testUnaryExpression() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/unaryExpression.kt"); - doTest(fileName); - } - - @TestMetadata("userType.kt") - public void testUserType() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/userType.kt"); - doTest(fileName); - } - - @TestMetadata("userTypeGeneric.kt") - public void testUserTypeGeneric() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/userTypeGeneric.kt"); - doTest(fileName); - } - - @TestMetadata("userTypeQualified.kt") - public void testUserTypeQualified() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/userTypeQualified.kt"); - doTest(fileName); + @TestMetadata("unaryExpression.kt") + public void testUnaryExpression() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls/unaryExpression.kt"); + doTestWoMethodCalls(fileName); + } } }