mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] find usages: process references from enum entries to enum primary constructor
^KTIJ-29756 fixed GitOrigin-RevId: 800ff40cdb031c3229bd7a1152d6913c3b3a26dd
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4cc5e5f9cb
commit
882dbec1fb
+13
@@ -1457,6 +1457,19 @@ public abstract class FindUsagesWithCompilerReferenceIndexFirTestGenerated exten
|
||||
}
|
||||
}
|
||||
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
@TestMetadata("../../idea/tests/testData/findUsages/kotlin/findClassUsages")
|
||||
public static class TestPrimaryConstructorOfEnum extends AbstractFindUsagesWithCompilerReferenceIndexFirTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
@TestMetadata("primaryConstructorOfEnum.0.kt")
|
||||
public void testPrimaryConstructorOfEnum() throws Exception {
|
||||
runTest("../../idea/tests/testData/findUsages/kotlin/findClassUsages/primaryConstructorOfEnum.0.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
@TestMetadata("../../idea/tests/testData/findUsages/kotlin/findClassUsages")
|
||||
public static class TestPrimaryConstructorWithDefaultParams extends AbstractFindUsagesWithCompilerReferenceIndexFirTest {
|
||||
|
||||
+13
@@ -1457,6 +1457,19 @@ public abstract class FindUsagesWithCompilerReferenceIndexTestGenerated extends
|
||||
}
|
||||
}
|
||||
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
@TestMetadata("../../idea/tests/testData/findUsages/kotlin/findClassUsages")
|
||||
public static class TestPrimaryConstructorOfEnum extends AbstractFindUsagesWithCompilerReferenceIndexTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
@TestMetadata("primaryConstructorOfEnum.0.kt")
|
||||
public void testPrimaryConstructorOfEnum() throws Exception {
|
||||
runTest("../../idea/tests/testData/findUsages/kotlin/findClassUsages/primaryConstructorOfEnum.0.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
@TestMetadata("../../idea/tests/testData/findUsages/kotlin/findClassUsages")
|
||||
public static class TestPrimaryConstructorWithDefaultParams extends AbstractFindUsagesWithCompilerReferenceIndexTest {
|
||||
|
||||
+5
@@ -609,6 +609,11 @@ public abstract class FindUsagesFirTestGenerated extends AbstractFindUsagesFirTe
|
||||
runTest("../../idea/tests/testData/findUsages/kotlin/findClassUsages/localAndNonLocalClass.0.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primaryConstructorOfEnum.0.kt")
|
||||
public void testPrimaryConstructorOfEnum() throws Exception {
|
||||
runTest("../../idea/tests/testData/findUsages/kotlin/findClassUsages/primaryConstructorOfEnum.0.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primaryConstructorWithDefaultParams.0.kt")
|
||||
public void testPrimaryConstructorWithDefaultParams() throws Exception {
|
||||
runTest("../../idea/tests/testData/findUsages/kotlin/findClassUsages/primaryConstructorWithDefaultParams.0.kt");
|
||||
|
||||
+5
@@ -609,6 +609,11 @@ public abstract class FindUsagesTestGenerated extends AbstractFindUsagesTest {
|
||||
runTest("testData/findUsages/kotlin/findClassUsages/localAndNonLocalClass.0.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primaryConstructorOfEnum.0.kt")
|
||||
public void testPrimaryConstructorOfEnum() throws Exception {
|
||||
runTest("testData/findUsages/kotlin/findClassUsages/primaryConstructorOfEnum.0.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primaryConstructorWithDefaultParams.0.kt")
|
||||
public void testPrimaryConstructorWithDefaultParams() throws Exception {
|
||||
runTest("testData/findUsages/kotlin/findClassUsages/primaryConstructorWithDefaultParams.0.kt");
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtClass
|
||||
// OPTIONS: usages, constructorUsages
|
||||
// PSI_ELEMENT_AS_TITLE: "class E"
|
||||
enum class <caret>E(b: Boolean) {
|
||||
A(false),
|
||||
B(true)
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
|
||||
+4
-1
@@ -87,7 +87,10 @@ class KotlinFindClassUsagesHandler(
|
||||
addTask { ReferencesSearch.search(constructor, options.searchScope).forEach(referenceProcessor) }
|
||||
addTask(
|
||||
constructor.buildProcessDelegationCallKotlinConstructorUsagesTask(options.searchScope) { callElement ->
|
||||
callElement.calleeExpression?.let { referenceProcessor.process(it.mainReference) } != false
|
||||
callElement.calleeExpression?.let { callee ->
|
||||
val reference = callee.mainReference
|
||||
reference == null || referenceProcessor.process(reference)
|
||||
} != false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user