Navigation to implementation: do not try to find expect enum inheritors
Before this commit, expect enum could find actual enum entries as its implementation, now it cannot. #KT-28206 Fixed
This commit is contained in:
+6
-1
@@ -50,7 +50,12 @@ class KotlinDefinitionsSearcher : QueryExecutor<PsiElement, DefinitionsScopedSea
|
|||||||
|
|
||||||
return when (element) {
|
return when (element) {
|
||||||
is KtClass -> {
|
is KtClass -> {
|
||||||
processClassImplementations(element, consumer) && processActualDeclarations(element, consumer)
|
val isExpectEnum = runReadAction { element.isEnum() && element.isExpectDeclaration() }
|
||||||
|
if (isExpectEnum) {
|
||||||
|
processActualDeclarations(element, consumer)
|
||||||
|
} else {
|
||||||
|
processClassImplementations(element, consumer) && processActualDeclarations(element, consumer)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
is KtObjectDeclaration -> {
|
is KtObjectDeclaration -> {
|
||||||
|
|||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
expect enum class <caret>Some {
|
||||||
|
FIRST,
|
||||||
|
SECOND
|
||||||
|
}
|
||||||
|
|
||||||
|
// REF: [testModule_JVM] (test).Some
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
actual enum class Some(val x: Int) {
|
||||||
|
FIRST(1),
|
||||||
|
SECOND(2)
|
||||||
|
}
|
||||||
+5
@@ -64,6 +64,11 @@ public class KotlinGotoImplementationMultiModuleTestGenerated extends AbstractKo
|
|||||||
runTest("idea/testData/navigation/implementations/multiModule/expectCompanion/");
|
runTest("idea/testData/navigation/implementations/multiModule/expectCompanion/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("expectEnumEntry")
|
||||||
|
public void testExpectEnumEntry() throws Exception {
|
||||||
|
runTest("idea/testData/navigation/implementations/multiModule/expectEnumEntry/");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("expectObject")
|
@TestMetadata("expectObject")
|
||||||
public void testExpectObject() throws Exception {
|
public void testExpectObject() throws Exception {
|
||||||
runTest("idea/testData/navigation/implementations/multiModule/expectObject/");
|
runTest("idea/testData/navigation/implementations/multiModule/expectObject/");
|
||||||
|
|||||||
Reference in New Issue
Block a user