EmitAndSemanticDiagnosticsBuilderProgram

The builder that can handle the changes in program and iterate through changed file to emit the files The semantic diagnostics are cached per file and managed by clearing for the changed/affected files

Functions

Link copied to clipboard
abstract fun emit(targetSourceFile: SourceFile = definedExternally, writeFile: WriteFileCallback = definedExternally, cancellationToken: CancellationToken = definedExternally, emitOnlyDtsFiles: Boolean = definedExternally, customTransformers: CustomTransformers = definedExternally): EmitResult

Emits the JavaScript and declaration files. When targetSource file is specified, emits the files corresponding to that source file, otherwise for the whole program. In case of EmitAndSemanticDiagnosticsBuilderProgram, when targetSourceFile is specified, it is assumed that that file is handled from affected file list. If targetSourceFile is not specified, it will only emit all the affected files instead of whole program

Link copied to clipboard
abstract fun emitNextAffectedFile(writeFile: WriteFileCallback = definedExternally, cancellationToken: CancellationToken = definedExternally, emitOnlyDtsFiles: Boolean = definedExternally, customTransformers: CustomTransformers = definedExternally): AffectedFileResult<EmitResult>

Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host in that order would be used to write the files

Link copied to clipboard

Get all the dependencies of the file

Link copied to clipboard

Get compiler options of the program

Link copied to clipboard

Get the diagnostics from config file parsing

Link copied to clipboard
abstract fun getCurrentDirectory(): String

Get the current directory of the program

Link copied to clipboard
abstract fun getDeclarationDiagnostics(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): ReadonlyArray<DiagnosticWithLocation>

Get the declaration diagnostics, for all source files if source file is not supplied

Link copied to clipboard
abstract fun getGlobalDiagnostics(cancellationToken: CancellationToken = definedExternally): ReadonlyArray<Diagnostic>

Get the diagnostics that dont belong to any file

Link copied to clipboard
abstract fun getOptionsDiagnostics(cancellationToken: CancellationToken = definedExternally): ReadonlyArray<Diagnostic>

Get the diagnostics for compiler options

Link copied to clipboard
abstract fun getProgram(): Program

Returns current program

Link copied to clipboard
abstract fun getSemanticDiagnostics(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): ReadonlyArray<Diagnostic>

Gets the semantic diagnostics from the program corresponding to this state of file (if provided) or whole program The semantic diagnostics are cached and managed here Note that it is assumed that when asked about semantic diagnostics through this API, the file has been taken out of affected files so it is safe to use cache or get from program and cache the diagnostics In case of SemanticDiagnosticsBuilderProgram if the source file is not provided, it will iterate through all the affected files, to ensure that cache stays valid and yet provide a way to get all semantic diagnostics

Link copied to clipboard
abstract fun getSemanticDiagnosticsOfNextAffectedFile(cancellationToken: CancellationToken = definedExternally, ignoreSourceFile: (sourceFile: SourceFile) -> Boolean = definedExternally): AffectedFileResult<ReadonlyArray<Diagnostic>>

Gets the semantic diagnostics from the program for the next affected file and caches it Returns undefined if the iteration is complete

Link copied to clipboard
abstract fun getSourceFile(fileName: String): SourceFile?

Get the source file in the program with file name

Link copied to clipboard

Get a list of files in the program

Link copied to clipboard
abstract fun getSyntacticDiagnostics(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): ReadonlyArray<Diagnostic>

Get the syntax diagnostics, for all source files if source file is not supplied