Add path to FirFile to pass it to the DiagnosticContext
This commit is contained in:
@@ -29,6 +29,7 @@ abstract class FirFile : FirAnnotatedDeclaration() {
|
||||
abstract val imports: List<FirImport>
|
||||
abstract val declarations: List<FirDeclaration>
|
||||
abstract val name: String
|
||||
abstract val path: String?
|
||||
abstract override val symbol: FirFileSymbol
|
||||
|
||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitFile(this, data)
|
||||
|
||||
@@ -39,6 +39,7 @@ class FirFileBuilder : FirAnnotationContainerBuilder {
|
||||
val imports: MutableList<FirImport> = mutableListOf()
|
||||
val declarations: MutableList<FirDeclaration> = mutableListOf()
|
||||
lateinit var name: String
|
||||
var path: String? = null
|
||||
|
||||
override fun build(): FirFile {
|
||||
return FirFileImpl(
|
||||
@@ -52,6 +53,7 @@ class FirFileBuilder : FirAnnotationContainerBuilder {
|
||||
imports,
|
||||
declarations,
|
||||
name,
|
||||
path,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ internal class FirFileImpl(
|
||||
override val imports: MutableList<FirImport>,
|
||||
override val declarations: MutableList<FirDeclaration>,
|
||||
override val name: String,
|
||||
override val path: String?,
|
||||
) : FirFile() {
|
||||
override val symbol: FirFileSymbol = FirFileSymbol()
|
||||
|
||||
|
||||
+1
@@ -415,6 +415,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
+fieldList(import).withTransform()
|
||||
+declarations.withTransform()
|
||||
+stringField("name")
|
||||
+stringField("path", nullable = true)
|
||||
+symbol("FirFileSymbol")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user