Skip to content

Commit

Permalink
Bump version to 4.0.4 and LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
typescript-bot committed Oct 19, 2020
1 parent 60ad73d commit cf13477
Show file tree
Hide file tree
Showing 10 changed files with 332 additions and 145 deletions.
6 changes: 6 additions & 0 deletions lib/protocol.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,11 @@ declare namespace ts.server.protocol {
* so this description should make sense by itself if the parent is inlineable=true
*/
description: string;
/**
* A message to show to the user if the refactoring cannot be applied in
* the current context.
*/
notApplicableReason?: string;
}
interface GetEditsForRefactorRequest extends Request {
command: CommandTypes.GetEditsForRefactor;
Expand Down Expand Up @@ -2473,6 +2478,7 @@ declare namespace ts.server.protocol {
readonly allowTextChangesInNewFiles?: boolean;
readonly lazyConfiguredProjectsFromExternalProject?: boolean;
readonly providePrefixAndSuffixTextForRename?: boolean;
readonly provideRefactorNotApplicableReason?: boolean;
readonly allowRenameOfImportPath?: boolean;
readonly includePackageJsonAutoImports?: "auto" | "on" | "off";
}
Expand Down
71 changes: 48 additions & 23 deletions lib/tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
var ts;
(function (ts) {
ts.versionMajorMinor = "4.0";
ts.version = "4.0.3";
ts.version = "4.0.4";
var NativeCollections;
(function (NativeCollections) {
function tryGetNativeMap() {
Expand Down Expand Up @@ -84207,6 +84207,7 @@ var ts;
getOptionsDiagnostics: getOptionsDiagnostics,
getGlobalDiagnostics: getGlobalDiagnostics,
getSemanticDiagnostics: getSemanticDiagnostics,
getCachedSemanticDiagnostics: getCachedSemanticDiagnostics,
getSuggestionDiagnostics: getSuggestionDiagnostics,
getDeclarationDiagnostics: getDeclarationDiagnostics,
getBindAndCheckDiagnostics: getBindAndCheckDiagnostics,
Expand Down Expand Up @@ -84721,6 +84722,11 @@ var ts;
function getSemanticDiagnostics(sourceFile, cancellationToken) {
return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken);
}
function getCachedSemanticDiagnostics(sourceFile) {
var _a;
return sourceFile
? (_a = cachedBindAndCheckDiagnosticsForFile.perFile) === null || _a === void 0 ? void 0 : _a.get(sourceFile.path) : cachedBindAndCheckDiagnosticsForFile.allDiagnostics;
}
function getBindAndCheckDiagnostics(sourceFile, cancellationToken) {
return getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken);
}
Expand Down Expand Up @@ -87315,30 +87321,49 @@ var ts;
return toAffectedFileEmitResult(state, ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles || emitKind === 0, customTransformers), affected, emitKind, isPendingEmitFile);
}
function emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {
var restorePendingEmitOnHandlingNoEmitSuccess = false;
var savedAffectedFilesPendingEmit;
var savedAffectedFilesPendingEmitKind;
var savedAffectedFilesPendingEmitIndex;
if (kind !== BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram &&
!targetSourceFile &&
!ts.outFile(state.compilerOptions) &&
!state.compilerOptions.noEmit &&
state.compilerOptions.noEmitOnError) {
restorePendingEmitOnHandlingNoEmitSuccess = true;
savedAffectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice();
savedAffectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind);
savedAffectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex;
}
if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {
assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile);
var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken);
if (result)
return result;
if (!targetSourceFile) {
var sourceMaps = [];
var emitSkipped = false;
var diagnostics = void 0;
var emittedFiles = [];
var affectedEmitResult = void 0;
while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) {
emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;
diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics);
emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles);
sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps);
}
return {
emitSkipped: emitSkipped,
diagnostics: diagnostics || ts.emptyArray,
emittedFiles: emittedFiles,
sourceMaps: sourceMaps
};
}
var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken);
if (result)
return result;
if (restorePendingEmitOnHandlingNoEmitSuccess) {
state.affectedFilesPendingEmit = savedAffectedFilesPendingEmit;
state.affectedFilesPendingEmitKind = savedAffectedFilesPendingEmitKind;
state.affectedFilesPendingEmitIndex = savedAffectedFilesPendingEmitIndex;
}
if (!targetSourceFile && kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {
var sourceMaps = [];
var emitSkipped = false;
var diagnostics = void 0;
var emittedFiles = [];
var affectedEmitResult = void 0;
while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) {
emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;
diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics);
emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles);
sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps);
}
return {
emitSkipped: emitSkipped,
diagnostics: diagnostics || ts.emptyArray,
emittedFiles: emittedFiles,
sourceMaps: sourceMaps
};
}
return ts.Debug.checkDefined(state.program).emit(targetSourceFile, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);
}
Expand All @@ -87351,7 +87376,7 @@ var ts;
else if (affected === state.program) {
return toAffectedFileResult(state, state.program.getSemanticDiagnostics(undefined, cancellationToken), affected);
}
if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {
if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram || state.compilerOptions.noEmit || state.compilerOptions.noEmitOnError) {
addToAffectedFilesPendingEmit(state, affected.resolvedPath, 1);
}
if (ignoreSourceFile && ignoreSourceFile(affected)) {
Expand Down
78 changes: 54 additions & 24 deletions lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ var ts;
// If changing the text in this section, be sure to test `configurePrerelease` too.
ts.versionMajorMinor = "4.0";
/** The version of the TypeScript compiler release */
ts.version = "4.0.3";
ts.version = "4.0.4";
/* @internal */
var Comparison;
(function (Comparison) {
Expand Down Expand Up @@ -102854,6 +102854,7 @@ var ts;
getOptionsDiagnostics: getOptionsDiagnostics,
getGlobalDiagnostics: getGlobalDiagnostics,
getSemanticDiagnostics: getSemanticDiagnostics,
getCachedSemanticDiagnostics: getCachedSemanticDiagnostics,
getSuggestionDiagnostics: getSuggestionDiagnostics,
getDeclarationDiagnostics: getDeclarationDiagnostics,
getBindAndCheckDiagnostics: getBindAndCheckDiagnostics,
Expand Down Expand Up @@ -103477,6 +103478,11 @@ var ts;
function getSemanticDiagnostics(sourceFile, cancellationToken) {
return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken);
}
function getCachedSemanticDiagnostics(sourceFile) {
var _a;
return sourceFile
? (_a = cachedBindAndCheckDiagnosticsForFile.perFile) === null || _a === void 0 ? void 0 : _a.get(sourceFile.path) : cachedBindAndCheckDiagnosticsForFile.allDiagnostics;
}
function getBindAndCheckDiagnostics(sourceFile, cancellationToken) {
return getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken);
}
Expand Down Expand Up @@ -106509,31 +106515,54 @@ var ts;
* in that order would be used to write the files
*/
function emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {
var restorePendingEmitOnHandlingNoEmitSuccess = false;
var savedAffectedFilesPendingEmit;
var savedAffectedFilesPendingEmitKind;
var savedAffectedFilesPendingEmitIndex;
// Backup and restore affected pendings emit state for non emit Builder if noEmitOnError is enabled and emitBuildInfo could be written in case there are errors
// This ensures pending files to emit is updated in tsbuildinfo
// Note that when there are no errors, emit proceeds as if everything is emitted as it is callers reponsibility to write the files to disk if at all (because its builder that doesnt track files to emit)
if (kind !== BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram &&
!targetSourceFile &&
!ts.outFile(state.compilerOptions) &&
!state.compilerOptions.noEmit &&
state.compilerOptions.noEmitOnError) {
restorePendingEmitOnHandlingNoEmitSuccess = true;
savedAffectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice();
savedAffectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind);
savedAffectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex;
}
if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {
assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile);
var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken);
if (result)
return result;
if (!targetSourceFile) {
// Emit and report any errors we ran into.
var sourceMaps = [];
var emitSkipped = false;
var diagnostics = void 0;
var emittedFiles = [];
var affectedEmitResult = void 0;
while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) {
emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;
diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics);
emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles);
sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps);
}
return {
emitSkipped: emitSkipped,
diagnostics: diagnostics || ts.emptyArray,
emittedFiles: emittedFiles,
sourceMaps: sourceMaps
};
}
var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken);
if (result)
return result;
if (restorePendingEmitOnHandlingNoEmitSuccess) {
state.affectedFilesPendingEmit = savedAffectedFilesPendingEmit;
state.affectedFilesPendingEmitKind = savedAffectedFilesPendingEmitKind;
state.affectedFilesPendingEmitIndex = savedAffectedFilesPendingEmitIndex;
}
// Emit only affected files if using builder for emit
if (!targetSourceFile && kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {
// Emit and report any errors we ran into.
var sourceMaps = [];
var emitSkipped = false;
var diagnostics = void 0;
var emittedFiles = [];
var affectedEmitResult = void 0;
while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) {
emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;
diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics);
emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles);
sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps);
}
return {
emitSkipped: emitSkipped,
diagnostics: diagnostics || ts.emptyArray,
emittedFiles: emittedFiles,
sourceMaps: sourceMaps
};
}
return ts.Debug.checkDefined(state.program).emit(targetSourceFile, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);
}
Expand All @@ -106553,7 +106582,8 @@ var ts;
return toAffectedFileResult(state, state.program.getSemanticDiagnostics(/*targetSourceFile*/ undefined, cancellationToken), affected);
}
// Add file to affected file pending emit to handle for later emit time
if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {
// Apart for emit builder do this for tsbuildinfo, do this for non emit builder when noEmit is set as tsbuildinfo is written and reused between emitters
if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram || state.compilerOptions.noEmit || state.compilerOptions.noEmitOnError) {
addToAffectedFilesPendingEmit(state, affected.resolvedPath, 1 /* Full */);
}
// Get diagnostics for the affected file if its not ignored
Expand Down
6 changes: 6 additions & 0 deletions lib/tsserverlibrary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6881,6 +6881,11 @@ declare namespace ts.server.protocol {
* so this description should make sense by itself if the parent is inlineable=true
*/
description: string;
/**
* A message to show to the user if the refactoring cannot be applied in
* the current context.
*/
notApplicableReason?: string;
}
interface GetEditsForRefactorRequest extends Request {
command: CommandTypes.GetEditsForRefactor;
Expand Down Expand Up @@ -8902,6 +8907,7 @@ declare namespace ts.server.protocol {
readonly allowTextChangesInNewFiles?: boolean;
readonly lazyConfiguredProjectsFromExternalProject?: boolean;
readonly providePrefixAndSuffixTextForRename?: boolean;
readonly provideRefactorNotApplicableReason?: boolean;
readonly allowRenameOfImportPath?: boolean;
readonly includePackageJsonAutoImports?: "auto" | "on" | "off";
}
Expand Down
Loading

0 comments on commit cf13477

Please sign in to comment.