Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KE2: Use the right file numbers #18016

Merged
merged 1 commit into from
Nov 19, 2024
Merged
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
8 changes: 4 additions & 4 deletions java/kotlin-extractor2/src/main/kotlin/KotlinExtractor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ fun doAnalysis(
var fileNumber = 0
val dump_psi = System.getenv("CODEQL_EXTRACTOR_JAVA_KOTLIN_DUMP") == "true"
for (psiFile in psiFiles) {
val thisFileNumber = fileNumber++
launch {
extractorThreads.withPermit {
if (psiFile is KtFile) {
Expand All @@ -251,11 +252,11 @@ fun doAnalysis(
val fileDiagnosticTrapWriter = dtw.makeSourceFileTrapWriter(psiFile, true)
fileDiagnosticTrapWriter.writeCompilation_compiling_files(
compilation,
fileNumber,
thisFileNumber,
fileDiagnosticTrapWriter.fileId
)
doFile(
fileNumber,
thisFileNumber,
compression,
/*
OLD: KE1
Expand All @@ -277,7 +278,7 @@ fun doAnalysis(
)
fileDiagnosticTrapWriter.writeCompilation_compiling_files_completed(
compilation,
fileNumber,
thisFileNumber,
fileExtractionProblems.extractionResult()
)
// We catch Throwable rather than Exception, as we want to
Expand All @@ -295,7 +296,6 @@ fun doAnalysis(
}
}
}
fileNumber += 1
}
}
}
Expand Down