From 99161bcb1ed92f01656ddd449d7721bd38bff4df Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 29 Aug 2024 11:56:56 +0100 Subject: [PATCH] KE2: Start writing the actual TRAP files --- .../src/main/kotlin/KotlinExtractor.kt | 11 +++++------ java/kotlin-extractor2/src/main/kotlin/TrapWriter.kt | 3 --- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/java/kotlin-extractor2/src/main/kotlin/KotlinExtractor.kt b/java/kotlin-extractor2/src/main/kotlin/KotlinExtractor.kt index 4f4b4d772f4..b0bb281987b 100644 --- a/java/kotlin-extractor2/src/main/kotlin/KotlinExtractor.kt +++ b/java/kotlin-extractor2/src/main/kotlin/KotlinExtractor.kt @@ -497,19 +497,18 @@ OLD: KE1 val trapFileWriter = getTrapFileWriter(compression, logger, checkTrapIdentical, trapFileName) trapFileWriter.run { trapFileBW -> - TODO() -/* -OLD: KE1 // We want our comments to be the first thing in the file, - // so start off with a mere TrapWriter + // so start off with a PlainTrapWriter val tw = PlainTrapWriter( loggerBase, TrapLabelManager(), trapFileBW, - fileTrapWriter.getDiagnosticTrapWriter() + fileDiagnosticTrapWriter.getDiagnosticTrapWriter() ) tw.writeComment("Generated by the CodeQL Kotlin extractor for kotlin source code") +/* +OLD: KE1 tw.writeComment("Part of invocation $invocationTrapFile") // Now elevate to a SourceFileTrapWriter, and populate the // file information @@ -523,7 +522,7 @@ OLD: KE1 primitiveTypeMapping, pluginContext, globalExtensionState, - fileTrapWriter.getDiagnosticTrapWriter() + fileDiagnosticTrapWriter.getDiagnosticTrapWriter() ) val linesOfCode = LinesOfCode(logger, sftw, srcFile) val fileExtractor = diff --git a/java/kotlin-extractor2/src/main/kotlin/TrapWriter.kt b/java/kotlin-extractor2/src/main/kotlin/TrapWriter.kt index fdc7c636d1d..1a90c45b530 100644 --- a/java/kotlin-extractor2/src/main/kotlin/TrapWriter.kt +++ b/java/kotlin-extractor2/src/main/kotlin/TrapWriter.kt @@ -299,8 +299,6 @@ OLD: KE1 ) } -/* -OLD: KE1 /** A `PlainTrapWriter` has no additional context of its own. */ class PlainTrapWriter( loggerBase: LoggerBase, @@ -312,7 +310,6 @@ class PlainTrapWriter( return dtw } } -*/ /** * A `DiagnosticTrapWriter` is a TrapWriter that diagnostics can be written to; i.e. it has