[LL FIR] fix user code leak from exceptions in :analysis:low-level-api-fir

Also, add more info to some exceptions
This commit is contained in:
Ilya Kirillov
2023-07-20 13:32:09 +02:00
committed by Space Team
parent df16fa3306
commit e3d2bccb33
16 changed files with 150 additions and 35 deletions
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.utils.exceptions
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.utils.getElementTextWithContext
@@ -12,4 +13,10 @@ fun ExceptionAttachmentBuilder.withPsiEntry(name: String, psi: PsiElement?) {
withEntry(name, psi) { psiElement ->
getElementTextWithContext(psiElement)
}
}
fun ExceptionAttachmentBuilder.withVirtualFileEntry(name: String, virtualFile: VirtualFile?) {
withEntry(name, virtualFile) { file ->
"path: ${file.path}, filetype: ${file.fileType} ,filesystem,${file.fileSystem}"
}
}