[FIR] add utilities to FIR compiler to throw error with attachment

This commit is contained in:
Ilya Kirillov
2023-06-30 18:17:50 +02:00
committed by Space Team
parent c5014d4765
commit a9cd881a07
20 changed files with 127 additions and 69 deletions
@@ -0,0 +1,15 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.utils.exceptions
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.utils.getElementTextWithContext
fun ExceptionAttachmentBuilder.withPsiEntry(name: String, psi: PsiElement?) {
withEntry(name, psi) { psiElement ->
getElementTextWithContext(psiElement)
}
}