mirror of
https://github.com/github/codeql.git
synced 2026-02-11 20:51:06 +01:00
Kotlin: Ensure the kotlin extractor is loaded as the last extension to be able to capture expansions from other extensions
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
import com.intellij.mock.MockProject
|
||||
import com.intellij.openapi.extensions.LoadingOrder
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
|
||||
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||
|
||||
@@ -16,14 +17,18 @@ class KotlinExtractorComponentRegistrar : Kotlin2ComponentRegistrar() {
|
||||
if (invocationTrapFile == null) {
|
||||
throw Exception("Required argument for TRAP invocation file not given")
|
||||
}
|
||||
IrGenerationExtension.registerExtension(
|
||||
project,
|
||||
// Register with LoadingOrder.LAST to ensure the extractor runs after other
|
||||
// IR generation plugins (like kotlinx.serialization) have generated their code.
|
||||
val extensionPoint = project.extensionArea.getExtensionPoint(IrGenerationExtension.extensionPointName)
|
||||
extensionPoint.registerExtension(
|
||||
KotlinExtractorExtension(
|
||||
invocationTrapFile,
|
||||
configuration[KEY_CHECK_TRAP_IDENTICAL] ?: false,
|
||||
configuration[KEY_COMPILATION_STARTTIME],
|
||||
configuration[KEY_EXIT_AFTER_EXTRACTION] ?: false
|
||||
)
|
||||
),
|
||||
LoadingOrder.LAST,
|
||||
project
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user