Navigation: add expect declarations as supers #KT-16892 Fixed

This commit is contained in:
Mikhail Glukhikh
2018-03-07 18:09:45 +03:00
parent 849f9fc5c1
commit ab30275f14
10 changed files with 99 additions and 14 deletions
@@ -22,7 +22,7 @@ import java.util.regex.Pattern;
@RunWith(JUnit3RunnerWithInners.class)
public class GotoSuperTestGenerated extends AbstractGotoSuperTest {
public void testAllFilesPresentInGotoSuper() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/navigation/gotoSuper"), Pattern.compile("^(.+)\\.test$"), TargetBackend.ANY, true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/navigation/gotoSuper"), Pattern.compile("^(.+)\\.test$"), TargetBackend.ANY, false);
}
@TestMetadata("BadPositionLambdaParameter.test")
@@ -0,0 +1,36 @@
/*
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.navigation
import com.intellij.codeInsight.navigation.GotoTargetHandler
import com.intellij.openapi.editor.Editor
import com.intellij.psi.PsiFile
import org.jetbrains.kotlin.idea.codeInsight.GotoSuperActionHandler
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase
import java.io.File
class KotlinGotoSuperMultiModuleTest : AbstractKotlinNavigationMultiModuleTest() {
override fun doNavigate(editor: Editor, file: PsiFile): GotoTargetHandler.GotoData {
val gotoAction = GotoSuperActionHandler()
val (superDeclarations, _) = gotoAction.allSuperDeclarationsAndDescriptor(editor, file)
return GotoTargetHandler.GotoData(file.findElementAt(editor.caretModel.offset)!!, superDeclarations.toTypedArray(), emptyList())
}
override fun getTestDataPath() =
File(PluginTestCaseBase.getTestDataPathBase(), "/navigation/gotoSuper/multiModule").path + File.separator
fun testActualClass() {
doMultiPlatformTest("jvm.kt")
}
fun testActualFunction() {
doMultiPlatformTest("jvm.kt")
}
fun testActualProperty() {
doMultiPlatformTest("jvm.kt")
}
}