mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Don't try to assign comments to fake overrides
This commit is contained in:
committed by
Ian Lynagh
parent
613e6b29a9
commit
8d6ae50d21
@@ -3,7 +3,9 @@ package com.github.codeql.utils
|
||||
import com.github.codeql.utils.versions.Psi2Ir
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.ir.util.isFakeOverride
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
class IrVisitorLookup(private val psi: PsiElement, private val file: IrFile) :
|
||||
@@ -18,6 +20,12 @@ class IrVisitorLookup(private val psi: PsiElement, private val file: IrFile) :
|
||||
return
|
||||
}
|
||||
|
||||
if (element is IrDeclaration && element.isFakeOverride) {
|
||||
// These aren't extracted, so we don't expect anything to exist
|
||||
// to which we could ascribe a comment.
|
||||
return
|
||||
}
|
||||
|
||||
if (location.contains(elementLocation)) {
|
||||
val psiElement = Psi2Ir().findPsiElement(element, file)
|
||||
if (psiElement == psi) {
|
||||
|
||||
Reference in New Issue
Block a user