Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ package land.sungbin.composeinvestigator.compiler.test
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mock.Linear
import androidx.compose.runtime.mock.Text
import land.sungbin.composeinvestigator.runtime.currentComposableInvalidationTracer

@Composable fun BasicLayout() {
println(currentComposableInvalidationTracer)
Text("Root")
Linear {
repeat(3) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirFileChecker
import org.jetbrains.kotlin.fir.analysis.extensions.FirAdditionalCheckersExtension
import org.jetbrains.kotlin.fir.declarations.FirFile
import org.jetbrains.kotlin.fir.declarations.hasAnnotation
import org.jetbrains.kotlin.fir.declarations.validate
import org.jetbrains.kotlin.fir.expressions.FirFunctionCall
import org.jetbrains.kotlin.fir.expressions.builder.buildAnnotation
import org.jetbrains.kotlin.fir.expressions.impl.FirEmptyAnnotationArgumentMapping
Expand Down Expand Up @@ -101,7 +100,7 @@ private object NoComposableFileChecker : FirFileChecker(MppCheckerKind.Common) {

declaration.replaceAnnotations(declaration.annotations.smartPlus(listOf(noInvestigationAnnotation)))

// Validate that the new annotations do not break the file.
declaration.validate()
// TODO Validate that the new annotations do not break the file.
// Blocked by KT-59621: declaration.validate()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

package land.sungbin.composeinvestigator.compiler.lower

import androidx.compose.compiler.plugins.kotlin.hasComposableAnnotation
import land.sungbin.composeinvestigator.compiler.COMPOSABLE_INVALIDATION_TRACE_TABLE_FQN
import land.sungbin.composeinvestigator.compiler.NO_INVESTIGATION_FQN
import land.sungbin.composeinvestigator.compiler.log
Expand Down Expand Up @@ -42,11 +41,11 @@ public class InvalidationTraceTableInstanceTransformer(
override fun visitFile(declaration: IrFile): IrFile =
includeFileIRInExceptionTrace(declaration) {
if (
declaration.hasAnnotation(NO_INVESTIGATION_FQN) ||
declaration.hasAnnotation(NO_INVESTIGATION_FQN)
// FIXME `fun c(l: @Composable () -> Unit)` ==> NO TABLE GENERATED
declaration.declarations
.filter { element -> element.hasComposableAnnotation() }
.all { element -> element.hasAnnotation(NO_INVESTIGATION_FQN) }
// declaration.declarations
// .filter { element -> element.hasComposableAnnotation() }
// .all { element -> element.hasAnnotation(NO_INVESTIGATION_FQN) }
)
return declaration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class InvalidationTraceTableIntrinsicTransformer(
override fun visitCall(expression: IrCall): IrExpression {
// TODO generating `throw Exception(NO_TABLE)` code to the target IR instead
// of throwing it here if no table exists
val table = tables[currentFile]
val table by lazy { tables[currentFile] }
return when (expression.symbol.owner.kotlinFqName) {
currentTableGetterSymbol.kotlinFqName -> {
table.propGetter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package land.sungbin.composeinvestigator.compiler.lower

import kotlin.test.Ignore
import kotlin.test.Test
import land.sungbin.composeinvestigator.compiler.FeatureFlag
import land.sungbin.composeinvestigator.compiler._compilation.AbstractCompilerTest
Expand Down Expand Up @@ -146,6 +147,7 @@ class InvalidationProcessTransformTest : AbstractCompilerTest(
"""
}

@Ignore("FIXME `fun c(l: @Composable () -> Unit)` ==> NO TABLE GENERATED")
@Test fun noInvestigationComposable() = clean(source("noInvestigationComposable.kt"))

@Test fun noInvestigationFile() = clean(source("noInvestigationFile.kt"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package land.sungbin.composeinvestigator.compiler.lower

import kotlin.test.Ignore
import kotlin.test.Test
import land.sungbin.composeinvestigator.compiler.FeatureFlag
import land.sungbin.composeinvestigator.compiler._compilation.AbstractCompilerTest
Expand Down Expand Up @@ -64,6 +65,7 @@ class InvalidationSkipTransformTest : AbstractCompilerTest(
""".trimIndent()
}

@Ignore("FIXME `fun c(l: @Composable () -> Unit)` ==> NO TABLE GENERATED")
@Test fun noInvestigationComposable() = clean(source("noInvestigationComposable.kt"))

@Test fun noInvestigationFile() = clean(source("noInvestigationFile.kt"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class InvalidationTraceTableInstantiateTest : AbstractCompilerTest(
enumSetOf(FeatureFlag.StateInitializerTracking),
sourceRoot = "lower/traceTableInstantiate",
) {
@Ignore("FIXME `fun c(l: @Composable () -> Unit)` ==> NO TABLE GENERATED")
@Test fun allComposableNoInvestigationFile() = clean(source("allComposableNoInvestigationFile.kt"))

@Test fun composableFunctionFile() = diff(source("composableFunctionFile.kt"), contextSize = 0) {
Expand All @@ -26,7 +27,7 @@ class InvalidationTraceTableInstantiateTest : AbstractCompilerTest(
"""
}

@Ignore("FIXME: `fun c(l: @Composable () -> Unit)` ==> NO TABLE GENERATED")
@Ignore("FIXME `fun c(l: @Composable () -> Unit)` ==> NO TABLE GENERATED")
@Test fun composableLambdaFile() = diff(source("composableLambdaFile.kt"), contextSize = 0) {
"""

Expand Down
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencyResolutionManagement {
releasesOnly()
}
}
maven("https://androidx.dev/snapshots/builds/12257077/artifacts/repository") {
maven("https://androidx.dev/snapshots/builds/12450542/artifacts/repository") {
mavenContent {
snapshotsOnly()
}
Expand All @@ -69,6 +69,6 @@ include(
":runtime",
":compiler",
":compiler-gradle-plugin",
// ":compiler-integration-test",
":compiler-integration-test",
// ":sample",
)