mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 22:51:17 -05:00
address PR feedback: add comments
This commit is contained in:
@@ -1031,6 +1031,7 @@ namespace ts {
|
||||
|
||||
function getDeclarationDiagnostics(sourceFile: SourceFile, cancellationToken: CancellationToken): Diagnostic[] {
|
||||
const options = program.getCompilerOptions();
|
||||
// collect diagnostics from the program only once if either no source file was specified or out/outFile is set (bundled emit)
|
||||
if (!sourceFile || options.out || options.outFile) {
|
||||
return getDeclarationDiagnosticsWorker(sourceFile, cancellationToken);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user