From b8fb002a8f645bec13cdbd875e283f9dd545c1e9 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Tue, 17 Oct 2017 20:58:19 +0300 Subject: [PATCH] Misc: Update keyword completion test data It reflects top-level lateinit variables available since 1.2 --- .../testData/keywords/AfterClasses.kt | 1 + .../keywords/AfterClasses_LangLevel11.kt | 39 +++++++++++++++++++ .../keywords/GlobalPropertyAccessors.kt | 1 + .../keywords/InTopScopeAfterPackage.kt | 1 + .../testData/keywords/TopScope.kt | 1 + .../test/AbstractKeywordCompletionTest.kt | 7 ++-- .../test/KeywordCompletionTestGenerated.java | 6 +++ .../test/KotlinProjectDescriptorWithFacet.kt | 1 + 8 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 idea/idea-completion/testData/keywords/AfterClasses_LangLevel11.kt diff --git a/idea/idea-completion/testData/keywords/AfterClasses.kt b/idea/idea-completion/testData/keywords/AfterClasses.kt index 26453ab3aef..ac93c40f3fe 100644 --- a/idea/idea-completion/testData/keywords/AfterClasses.kt +++ b/idea/idea-completion/testData/keywords/AfterClasses.kt @@ -38,4 +38,5 @@ class B { // EXIST: typealias // EXIST: expect // EXIST: actual +// EXIST: lateinit var // NOTHING_ELSE diff --git a/idea/idea-completion/testData/keywords/AfterClasses_LangLevel11.kt b/idea/idea-completion/testData/keywords/AfterClasses_LangLevel11.kt new file mode 100644 index 00000000000..39c0e54141f --- /dev/null +++ b/idea/idea-completion/testData/keywords/AfterClasses_LangLevel11.kt @@ -0,0 +1,39 @@ +class A { + fun foo() { + bar() + } +} + +class B { + fun bar() { + foo() + } +} + + + +// EXIST: abstract +// EXIST: class +// EXIST: enum class +// EXIST: final +// EXIST: fun +// EXIST: internal +// EXIST: object +// EXIST: open +// EXIST: private +// EXIST: public +// EXIST: interface +// EXIST: val +// EXIST: var +// EXIST: operator +// EXIST: infix +// EXIST: sealed class +// EXIST: data +// EXIST: inline +// EXIST: tailrec +// EXIST: external +// EXIST: annotation class +// EXIST: const +// EXIST: suspend +// EXIST: typealias +// NOTHING_ELSE diff --git a/idea/idea-completion/testData/keywords/GlobalPropertyAccessors.kt b/idea/idea-completion/testData/keywords/GlobalPropertyAccessors.kt index a519c1d6489..74c9939836a 100644 --- a/idea/idea-completion/testData/keywords/GlobalPropertyAccessors.kt +++ b/idea/idea-completion/testData/keywords/GlobalPropertyAccessors.kt @@ -42,4 +42,5 @@ var a : Int // EXIST: typealias // EXIST: expect // EXIST: actual +// EXIST: lateinit var // NOTHING_ELSE diff --git a/idea/idea-completion/testData/keywords/InTopScopeAfterPackage.kt b/idea/idea-completion/testData/keywords/InTopScopeAfterPackage.kt index b80f69927d4..6dbcbec8d53 100644 --- a/idea/idea-completion/testData/keywords/InTopScopeAfterPackage.kt +++ b/idea/idea-completion/testData/keywords/InTopScopeAfterPackage.kt @@ -29,4 +29,5 @@ package Test // EXIST: typealias // EXIST: expect // EXIST: actual +// EXIST: lateinit var // NOTHING_ELSE diff --git a/idea/idea-completion/testData/keywords/TopScope.kt b/idea/idea-completion/testData/keywords/TopScope.kt index 4ae103601a4..200e492b4ac 100644 --- a/idea/idea-completion/testData/keywords/TopScope.kt +++ b/idea/idea-completion/testData/keywords/TopScope.kt @@ -28,4 +28,5 @@ // EXIST: typealias // EXIST: expect // EXIST: actual +// EXIST: lateinit var // NOTHING_ELSE diff --git a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/AbstractKeywordCompletionTest.kt b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/AbstractKeywordCompletionTest.kt index 873fbadcca0..0cff1d7f38a 100644 --- a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/AbstractKeywordCompletionTest.kt +++ b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/AbstractKeywordCompletionTest.kt @@ -34,10 +34,11 @@ abstract class AbstractKeywordCompletionTest : KotlinFixtureCompletionBaseTestCa } override fun getProjectDescriptor(): KotlinLightProjectDescriptor { - if ("LangLevel10" in fileName()) { - return KotlinProjectDescriptorWithFacet.KOTLIN_10 + when { + "LangLevel10" in fileName() -> return KotlinProjectDescriptorWithFacet.KOTLIN_10 + "LangLevel11" in fileName() -> return KotlinProjectDescriptorWithFacet.KOTLIN_11 + else -> return KotlinProjectDescriptorWithFacet.KOTLIN_STABLE_WITH_MULTIPLATFORM } - return KotlinProjectDescriptorWithFacet.KOTLIN_STABLE_WITH_MULTIPLATFORM } override fun defaultInvocationCount() = 1 diff --git a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/KeywordCompletionTestGenerated.java b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/KeywordCompletionTestGenerated.java index 3ad7f7a1ae8..03124e4f78f 100644 --- a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/KeywordCompletionTestGenerated.java +++ b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/KeywordCompletionTestGenerated.java @@ -50,6 +50,12 @@ public class KeywordCompletionTestGenerated extends AbstractKeywordCompletionTes doTest(fileName); } + @TestMetadata("AfterClasses_LangLevel11.kt") + public void testAfterClasses_LangLevel11() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/keywords/AfterClasses_LangLevel11.kt"); + doTest(fileName); + } + @TestMetadata("AfterDot.kt") public void testAfterDot() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/keywords/AfterDot.kt"); diff --git a/idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/KotlinProjectDescriptorWithFacet.kt b/idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/KotlinProjectDescriptorWithFacet.kt index ec1ae73d58d..41065431223 100644 --- a/idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/KotlinProjectDescriptorWithFacet.kt +++ b/idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/KotlinProjectDescriptorWithFacet.kt @@ -46,6 +46,7 @@ class KotlinProjectDescriptorWithFacet( companion object { val KOTLIN_10 = KotlinProjectDescriptorWithFacet(LanguageVersion.KOTLIN_1_0) + val KOTLIN_11 = KotlinProjectDescriptorWithFacet(LanguageVersion.KOTLIN_1_1) val KOTLIN_STABLE_WITH_MULTIPLATFORM = KotlinProjectDescriptorWithFacet(LanguageVersion.LATEST_STABLE, multiPlatform = true) } }