mirror of
https://github.com/github/codeql.git
synced 2026-05-23 23:57:06 +02:00
KE2: Start turning KotlinUsesExtractor back on
This commit is contained in:
@@ -78,7 +78,7 @@ open class KotlinFileExtractor(
|
||||
OLD: KE1
|
||||
override val logger: FileLogger,
|
||||
*/
|
||||
/* TODO override */ val tw: FileTrapWriter,
|
||||
override val tw: FileTrapWriter,
|
||||
/*
|
||||
OLD: KE1
|
||||
val linesOfCode: LinesOfCode?,
|
||||
@@ -90,20 +90,25 @@ OLD: KE1
|
||||
val declarationStack: DeclarationStack,
|
||||
globalExtensionState: KotlinExtractorGlobalState,
|
||||
*/
|
||||
) {
|
||||
/*
|
||||
OLD: KE1
|
||||
) :
|
||||
KotlinUsesExtractor(
|
||||
/*
|
||||
OLD: KE1
|
||||
logger,
|
||||
*/
|
||||
tw,
|
||||
/*
|
||||
OLD: KE1
|
||||
dependencyCollector,
|
||||
externalClassExtractor,
|
||||
primitiveTypeMapping,
|
||||
pluginContext,
|
||||
globalExtensionState
|
||||
*/
|
||||
) {
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
val usesK2 = usesK2(pluginContext)
|
||||
val metaAnnotationSupport = MetaAnnotationSupport(logger, pluginContext, this)
|
||||
*/
|
||||
@@ -144,9 +149,9 @@ OLD: KE1
|
||||
fun extractFileContents(file: KtFile, id: Label<DbFile>) {
|
||||
with("file", file) {
|
||||
val locId = tw.getWholeFileLocation()
|
||||
val pkg = file.packageFqName.asString()
|
||||
/*
|
||||
OLD: KE1
|
||||
val pkg = file.packageFqName.asString()
|
||||
val pkgId = extractPackage(pkg)
|
||||
tw.writeHasLocation(id, locId)
|
||||
tw.writeCupackage(id, pkgId)
|
||||
|
||||
@@ -28,16 +28,25 @@ import org.jetbrains.kotlin.name.NameUtils
|
||||
import org.jetbrains.kotlin.name.SpecialNames
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions
|
||||
*/
|
||||
|
||||
open class KotlinUsesExtractor(
|
||||
/*
|
||||
OLD: KE1
|
||||
open val logger: Logger,
|
||||
*/
|
||||
open val tw: TrapWriter,
|
||||
/*
|
||||
OLD: KE1
|
||||
val dependencyCollector: OdasaOutput.TrapFileManager?,
|
||||
val externalClassExtractor: ExternalDeclExtractor,
|
||||
val primitiveTypeMapping: PrimitiveTypeMapping,
|
||||
val pluginContext: IrPluginContext,
|
||||
val globalExtensionState: KotlinExtractorGlobalState
|
||||
*/
|
||||
) {
|
||||
/*
|
||||
OLD: KE1
|
||||
fun referenceExternalClass(name: String) =
|
||||
getClassByFqName(pluginContext, FqName(name))?.owner.also {
|
||||
if (it == null) logger.warn("Unable to resolve external class $name")
|
||||
@@ -2250,5 +2259,5 @@ open class KotlinUsesExtractor(
|
||||
fun useVariable(v: IrVariable): Label<out DbLocalvar> {
|
||||
return tw.getVariableLabelFor<DbLocalvar>(v)
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ OLD: KE1
|
||||
* is lazy, as we don't want to define it in a TRAP file unless the TRAP file actually contains
|
||||
* something in the 'unknown' file.
|
||||
*/
|
||||
protected val unknownFileId: Label<DbFile> by lazy {
|
||||
private val unknownFileId: Label<DbFile> by lazy {
|
||||
val unknownFileLabel = "@\";sourcefile\""
|
||||
getLabelFor(unknownFileLabel, { writeFiles(it, "") })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user