зеркало из https://github.com/github/codeql.git
Merge pull request #11401 from igfoo/igfoo/unused
Kotlin: Remove an unused argument
This commit is contained in:
Коммит
184c903ec7
|
@ -16,7 +16,7 @@ class LinesOfCode(
|
|||
val tw: FileTrapWriter,
|
||||
val file: IrFile
|
||||
) {
|
||||
val psi2Ir = getPsi2Ir(logger).also {
|
||||
val psi2Ir = getPsi2Ir().also {
|
||||
if (it == null) {
|
||||
logger.warn("Lines of code will not be populated as Kotlin version is too old (${KotlinCompilerVersion.getVersion()})")
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class CommentExtractor(private val fileExtractor: KotlinFileExtractor, private v
|
|||
private val logger = fileExtractor.logger
|
||||
|
||||
fun extract() {
|
||||
val psi2Ir = getPsi2Ir(logger)
|
||||
val psi2Ir = getPsi2Ir()
|
||||
if (psi2Ir == null) {
|
||||
logger.warn("Comments will not be extracted as Kotlin version is too old (${KotlinCompilerVersion.getVersion()})")
|
||||
return
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
package com.github.codeql.utils.versions
|
||||
|
||||
import com.github.codeql.FileLogger
|
||||
|
||||
fun getPsi2Ir(@Suppress("UNUSED_PARAMETER") logger: FileLogger): Psi2IrFacade? = null
|
||||
fun getPsi2Ir(): Psi2IrFacade? = null
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.github.codeql.utils.versions
|
||||
|
||||
import com.github.codeql.FileLogger
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.backend.common.psi.PsiSourceManager
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.getKtFile
|
||||
|
@ -8,9 +7,9 @@ import org.jetbrains.kotlin.ir.IrElement
|
|||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
|
||||
fun getPsi2Ir(logger: FileLogger): Psi2IrFacade? = Psi2Ir(logger)
|
||||
fun getPsi2Ir(): Psi2IrFacade? = Psi2Ir()
|
||||
|
||||
private class Psi2Ir(private val logger: FileLogger): Psi2IrFacade {
|
||||
private class Psi2Ir(): Psi2IrFacade {
|
||||
override fun getKtFile(irFile: IrFile): KtFile? {
|
||||
return irFile.getKtFile()
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче