Skip to content

Commit

Permalink
Update LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
mhegazy committed Feb 25, 2016
1 parent 602127d commit acd9bef
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 34 deletions.
23 changes: 15 additions & 8 deletions lib/tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24942,7 +24942,7 @@ var ts;
function getDeclarationDiagnostics(host, resolver, targetSourceFile) {
var declarationDiagnostics = ts.createDiagnosticCollection();
ts.forEachExpectedEmitFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile);
return declarationDiagnostics.getDiagnostics(targetSourceFile.fileName);
return declarationDiagnostics.getDiagnostics(targetSourceFile ? targetSourceFile.fileName : undefined);
function getDeclarationDiagnosticsFromFile(_a, sources, isBundledEmit) {
var declarationFilePath = _a.declarationFilePath;
emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sources, isBundledEmit);
Expand Down Expand Up @@ -32972,7 +32972,13 @@ var ts;
return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken);
}
function getDeclarationDiagnostics(sourceFile, cancellationToken) {
return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken);
var options = program.getCompilerOptions();
if (!sourceFile || options.out || options.outFile) {
return getDeclarationDiagnosticsWorker(sourceFile, cancellationToken);
}
else {
return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken);
}
}
function getSyntacticDiagnosticsForFile(sourceFile, cancellationToken) {
return sourceFile.parseDiagnostics;
Expand Down Expand Up @@ -33153,15 +33159,16 @@ var ts;
}
});
}
function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) {
function getDeclarationDiagnosticsWorker(sourceFile, cancellationToken) {
return runWithCancellationToken(function () {
if (!ts.isDeclarationFile(sourceFile)) {
var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken);
var writeFile_1 = function () { };
return ts.getDeclarationDiagnostics(getEmitHost(writeFile_1), resolver, sourceFile);
}
var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken);
var writeFile = function () { };
return ts.getDeclarationDiagnostics(getEmitHost(writeFile), resolver, sourceFile);
});
}
function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) {
return ts.isDeclarationFile(sourceFile) ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken);
}
function getOptionsDiagnostics() {
var allDiagnostics = [];
ts.addRange(allDiagnostics, fileProcessingDiagnostics.getGlobalDiagnostics());
Expand Down
23 changes: 15 additions & 8 deletions lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -25510,7 +25510,7 @@ var ts;
function getDeclarationDiagnostics(host, resolver, targetSourceFile) {
var declarationDiagnostics = ts.createDiagnosticCollection();
ts.forEachExpectedEmitFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile);
return declarationDiagnostics.getDiagnostics(targetSourceFile.fileName);
return declarationDiagnostics.getDiagnostics(targetSourceFile ? targetSourceFile.fileName : undefined);
function getDeclarationDiagnosticsFromFile(_a, sources, isBundledEmit) {
var declarationFilePath = _a.declarationFilePath;
emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sources, isBundledEmit);
Expand Down Expand Up @@ -33540,7 +33540,13 @@ var ts;
return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken);
}
function getDeclarationDiagnostics(sourceFile, cancellationToken) {
return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken);
var options = program.getCompilerOptions();
if (!sourceFile || options.out || options.outFile) {
return getDeclarationDiagnosticsWorker(sourceFile, cancellationToken);
}
else {
return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken);
}
}
function getSyntacticDiagnosticsForFile(sourceFile, cancellationToken) {
return sourceFile.parseDiagnostics;
Expand Down Expand Up @@ -33721,15 +33727,16 @@ var ts;
}
});
}
function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) {
function getDeclarationDiagnosticsWorker(sourceFile, cancellationToken) {
return runWithCancellationToken(function () {
if (!ts.isDeclarationFile(sourceFile)) {
var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken);
var writeFile_1 = function () { };
return ts.getDeclarationDiagnostics(getEmitHost(writeFile_1), resolver, sourceFile);
}
var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken);
var writeFile = function () { };
return ts.getDeclarationDiagnostics(getEmitHost(writeFile), resolver, sourceFile);
});
}
function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) {
return ts.isDeclarationFile(sourceFile) ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken);
}
function getOptionsDiagnostics() {
var allDiagnostics = [];
ts.addRange(allDiagnostics, fileProcessingDiagnostics.getGlobalDiagnostics());
Expand Down
26 changes: 17 additions & 9 deletions lib/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -30548,7 +30548,7 @@ var ts;
function getDeclarationDiagnostics(host, resolver, targetSourceFile) {
var declarationDiagnostics = ts.createDiagnosticCollection();
ts.forEachExpectedEmitFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile);
return declarationDiagnostics.getDiagnostics(targetSourceFile.fileName);
return declarationDiagnostics.getDiagnostics(targetSourceFile ? targetSourceFile.fileName : undefined);
function getDeclarationDiagnosticsFromFile(_a, sources, isBundledEmit) {
var declarationFilePath = _a.declarationFilePath;
emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sources, isBundledEmit);
Expand Down Expand Up @@ -39825,7 +39825,14 @@ var ts;
return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken);
}
function getDeclarationDiagnostics(sourceFile, cancellationToken) {
return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken);
var 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);
}
else {
return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken);
}
}
function getSyntacticDiagnosticsForFile(sourceFile, cancellationToken) {
return sourceFile.parseDiagnostics;
Expand Down Expand Up @@ -40019,16 +40026,17 @@ var ts;
}
});
}
function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) {
function getDeclarationDiagnosticsWorker(sourceFile, cancellationToken) {
return runWithCancellationToken(function () {
if (!ts.isDeclarationFile(sourceFile)) {
var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken);
// Don't actually write any files since we're just getting diagnostics.
var writeFile_1 = function () { };
return ts.getDeclarationDiagnostics(getEmitHost(writeFile_1), resolver, sourceFile);
}
var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken);
// Don't actually write any files since we're just getting diagnostics.
var writeFile = function () { };
return ts.getDeclarationDiagnostics(getEmitHost(writeFile), resolver, sourceFile);
});
}
function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) {
return ts.isDeclarationFile(sourceFile) ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken);
}
function getOptionsDiagnostics() {
var allDiagnostics = [];
ts.addRange(allDiagnostics, fileProcessingDiagnostics.getGlobalDiagnostics());
Expand Down
26 changes: 17 additions & 9 deletions lib/typescriptServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -30548,7 +30548,7 @@ var ts;
function getDeclarationDiagnostics(host, resolver, targetSourceFile) {
var declarationDiagnostics = ts.createDiagnosticCollection();
ts.forEachExpectedEmitFile(host, getDeclarationDiagnosticsFromFile, targetSourceFile);
return declarationDiagnostics.getDiagnostics(targetSourceFile.fileName);
return declarationDiagnostics.getDiagnostics(targetSourceFile ? targetSourceFile.fileName : undefined);
function getDeclarationDiagnosticsFromFile(_a, sources, isBundledEmit) {
var declarationFilePath = _a.declarationFilePath;
emitDeclarations(host, resolver, declarationDiagnostics, declarationFilePath, sources, isBundledEmit);
Expand Down Expand Up @@ -39825,7 +39825,14 @@ var ts;
return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken);
}
function getDeclarationDiagnostics(sourceFile, cancellationToken) {
return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken);
var 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);
}
else {
return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken);
}
}
function getSyntacticDiagnosticsForFile(sourceFile, cancellationToken) {
return sourceFile.parseDiagnostics;
Expand Down Expand Up @@ -40019,16 +40026,17 @@ var ts;
}
});
}
function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) {
function getDeclarationDiagnosticsWorker(sourceFile, cancellationToken) {
return runWithCancellationToken(function () {
if (!ts.isDeclarationFile(sourceFile)) {
var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken);
// Don't actually write any files since we're just getting diagnostics.
var writeFile_1 = function () { };
return ts.getDeclarationDiagnostics(getEmitHost(writeFile_1), resolver, sourceFile);
}
var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken);
// Don't actually write any files since we're just getting diagnostics.
var writeFile = function () { };
return ts.getDeclarationDiagnostics(getEmitHost(writeFile), resolver, sourceFile);
});
}
function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) {
return ts.isDeclarationFile(sourceFile) ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken);
}
function getOptionsDiagnostics() {
var allDiagnostics = [];
ts.addRange(allDiagnostics, fileProcessingDiagnostics.getGlobalDiagnostics());
Expand Down

0 comments on commit acd9bef

Please sign in to comment.