diff --git a/analysis/low-level-api-fir/testData/contextCollector/fileImport.copy.txt b/analysis/low-level-api-fir/testData/contextCollector/fileImport.copy.txt new file mode 100644 index 00000000000..fa335999d10 --- /dev/null +++ b/analysis/low-level-api-fir/testData/contextCollector/fileImport.copy.txt @@ -0,0 +1,24 @@ +Tower Data Context: + Element 0 + Scope: FirDefaultStarImportingScope + Element 1 + Scope: FirExplicitStarImportingScope + Element 2 + Scope: FirDefaultSimpleImportingScope + Element 3 + Scope: FirDefaultSimpleImportingScope + Element 4 + Scope: FirPackageMemberScope + Element 5 + Scope: FirExplicitSimpleImportingScope + Import name:Anno + Qualified name: foo.Anno + Is all under: false + +FILE: [ResolvedTo(IMPORTS)] fileImport.kt + @R|kotlin/annotation/Target|[Types](FILE#) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] constructor(): R|foo/Anno| { + LAZY_super + } + + } diff --git a/analysis/low-level-api-fir/testData/contextCollector/fileImport.kt b/analysis/low-level-api-fir/testData/contextCollector/fileImport.kt new file mode 100644 index 00000000000..37b59275280 --- /dev/null +++ b/analysis/low-level-api-fir/testData/contextCollector/fileImport.kt @@ -0,0 +1,6 @@ +package foo + +import foo.Anno + +@Target(FILE) +annotation class Anno \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/contextCollector/fileImport.txt b/analysis/low-level-api-fir/testData/contextCollector/fileImport.txt new file mode 100644 index 00000000000..5919feee0f3 --- /dev/null +++ b/analysis/low-level-api-fir/testData/contextCollector/fileImport.txt @@ -0,0 +1,24 @@ +Tower Data Context: + Element 0 + Scope: FirDefaultStarImportingScope + Element 1 + Scope: FirExplicitStarImportingScope + Element 2 + Scope: FirDefaultSimpleImportingScope + Element 3 + Scope: FirDefaultSimpleImportingScope + Element 4 + Scope: FirPackageMemberScope + Element 5 + Scope: FirExplicitSimpleImportingScope + Import name:Anno + Qualified name: foo.Anno + Is all under: false + +FILE: [ResolvedTo(IMPORTS)] fileImport.kt + @R|kotlin/annotation/Target|[Types](FILE#) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] constructor(): R|foo/Anno| { + LAZY_super + } + + } diff --git a/analysis/low-level-api-fir/testData/contextCollector/fileImportInside.copy.txt b/analysis/low-level-api-fir/testData/contextCollector/fileImportInside.copy.txt new file mode 100644 index 00000000000..feaec92903f --- /dev/null +++ b/analysis/low-level-api-fir/testData/contextCollector/fileImportInside.copy.txt @@ -0,0 +1,24 @@ +Tower Data Context: + Element 0 + Scope: FirDefaultStarImportingScope + Element 1 + Scope: FirExplicitStarImportingScope + Element 2 + Scope: FirDefaultSimpleImportingScope + Element 3 + Scope: FirDefaultSimpleImportingScope + Element 4 + Scope: FirPackageMemberScope + Element 5 + Scope: FirExplicitSimpleImportingScope + Import name:Anno + Qualified name: foo.Anno + Is all under: false + +FILE: [ResolvedTo(IMPORTS)] fileImportInside.kt + @R|kotlin/annotation/Target|[Types](FILE#) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(BODY_RESOLVE)] constructor(): R|foo/Anno| { + super() + } + + } diff --git a/analysis/low-level-api-fir/testData/contextCollector/fileImportInside.kt b/analysis/low-level-api-fir/testData/contextCollector/fileImportInside.kt new file mode 100644 index 00000000000..d425201442e --- /dev/null +++ b/analysis/low-level-api-fir/testData/contextCollector/fileImportInside.kt @@ -0,0 +1,6 @@ +package foo + +import foo.Anno + +@Target(FILE) +annotation class Anno \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/contextCollector/fileImportInside.txt b/analysis/low-level-api-fir/testData/contextCollector/fileImportInside.txt new file mode 100644 index 00000000000..a512dee3fdd --- /dev/null +++ b/analysis/low-level-api-fir/testData/contextCollector/fileImportInside.txt @@ -0,0 +1,24 @@ +Tower Data Context: + Element 0 + Scope: FirDefaultStarImportingScope + Element 1 + Scope: FirExplicitStarImportingScope + Element 2 + Scope: FirDefaultSimpleImportingScope + Element 3 + Scope: FirDefaultSimpleImportingScope + Element 4 + Scope: FirPackageMemberScope + Element 5 + Scope: FirExplicitSimpleImportingScope + Import name:Anno + Qualified name: foo.Anno + Is all under: false + +FILE: [ResolvedTo(IMPORTS)] fileImportInside.kt + @R|kotlin/annotation/Target|[Types](allowedTargets = vararg(#)) public final [ResolvedTo(ANNOTATION_ARGUMENTS)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(BODY_RESOLVE)] constructor(): R|foo/Anno| { + super() + } + + } diff --git a/analysis/low-level-api-fir/testData/contextCollector/filePackage.copy.txt b/analysis/low-level-api-fir/testData/contextCollector/filePackage.copy.txt new file mode 100644 index 00000000000..6cab121921f --- /dev/null +++ b/analysis/low-level-api-fir/testData/contextCollector/filePackage.copy.txt @@ -0,0 +1,21 @@ +Tower Data Context: + Element 0 + Scope: FirDefaultStarImportingScope + Element 1 + Scope: FirExplicitStarImportingScope + Element 2 + Scope: FirDefaultSimpleImportingScope + Element 3 + Scope: FirDefaultSimpleImportingScope + Element 4 + Scope: FirPackageMemberScope + Element 5 + Scope: FirExplicitSimpleImportingScope + +FILE: [ResolvedTo(IMPORTS)] filePackage.kt + @R|kotlin/annotation/Target|[Types](FILE#) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] constructor(): R|foo/Anno| { + LAZY_super + } + + } diff --git a/analysis/low-level-api-fir/testData/contextCollector/filePackage.kt b/analysis/low-level-api-fir/testData/contextCollector/filePackage.kt new file mode 100644 index 00000000000..6979854e99c --- /dev/null +++ b/analysis/low-level-api-fir/testData/contextCollector/filePackage.kt @@ -0,0 +1,4 @@ +package foo + +@Target(FILE) +annotation class Anno \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/contextCollector/filePackage.txt b/analysis/low-level-api-fir/testData/contextCollector/filePackage.txt new file mode 100644 index 00000000000..82e08295fbd --- /dev/null +++ b/analysis/low-level-api-fir/testData/contextCollector/filePackage.txt @@ -0,0 +1,21 @@ +Tower Data Context: + Element 0 + Scope: FirDefaultStarImportingScope + Element 1 + Scope: FirExplicitStarImportingScope + Element 2 + Scope: FirDefaultSimpleImportingScope + Element 3 + Scope: FirDefaultSimpleImportingScope + Element 4 + Scope: FirPackageMemberScope + Element 5 + Scope: FirExplicitSimpleImportingScope + +FILE: [ResolvedTo(IMPORTS)] filePackage.kt + @R|kotlin/annotation/Target|[Types](FILE#) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] constructor(): R|foo/Anno| { + LAZY_super + } + + } diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/ContextCollectorSourceTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/ContextCollectorSourceTestGenerated.java index 8f936db0066..1b3d446c43d 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/ContextCollectorSourceTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/ContextCollectorSourceTestGenerated.java @@ -84,6 +84,24 @@ public class ContextCollectorSourceTestGenerated extends AbstractContextCollecto runTest("analysis/low-level-api-fir/testData/contextCollector/fileAnnotation.kt"); } + @Test + @TestMetadata("fileImport.kt") + public void testFileImport() throws Exception { + runTest("analysis/low-level-api-fir/testData/contextCollector/fileImport.kt"); + } + + @Test + @TestMetadata("fileImportInside.kt") + public void testFileImportInside() throws Exception { + runTest("analysis/low-level-api-fir/testData/contextCollector/fileImportInside.kt"); + } + + @Test + @TestMetadata("filePackage.kt") + public void testFilePackage() throws Exception { + runTest("analysis/low-level-api-fir/testData/contextCollector/filePackage.kt"); + } + @Test @TestMetadata("forLoopVariable.kt") public void testForLoopVariable() throws Exception {