getSemanticDiagnostics

abstract fun getSemanticDiagnostics(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): ReadonlyArray<Diagnostic>(source)

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