FIR LT: add syntax error reporting to LT2Fir

use it in the new pipeline
This commit is contained in:
Ilya Chernikov
2021-12-29 22:08:21 +01:00
committed by teamcity
parent 2689ebf455
commit 9e32188938
21 changed files with 98 additions and 40 deletions
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.fir.pipeline
import org.jetbrains.kotlin.diagnostics.DiagnosticReporter
import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.builder.PsiHandlingMode
import org.jetbrains.kotlin.fir.builder.RawFirBuilder
@@ -16,10 +17,10 @@ import org.jetbrains.kotlin.fir.session.sourcesToPathsMapper
import org.jetbrains.kotlin.psi.KtFile
import java.io.File
fun FirSession.buildFirViaLightTree(files: Collection<File>): List<FirFile> {
fun FirSession.buildFirViaLightTree(files: Collection<File>, diagnosticsReporter: DiagnosticReporter? = null): List<FirFile> {
val firProvider = (firProvider as FirProviderImpl)
val sourcesToPathsMapper = sourcesToPathsMapper
val builder = LightTree2Fir(this, firProvider.kotlinScopeProvider)
val builder = LightTree2Fir(this, firProvider.kotlinScopeProvider, diagnosticsReporter)
return files.map {
builder.buildFirFile(it).also { firFile ->
firProvider.recordFile(firFile)