Skip to content

Commit

Permalink
Update LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Lichtman committed Jun 12, 2019
1 parent fbe2f2f commit 7f47a08
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 114 deletions.
140 changes: 70 additions & 70 deletions lib/ko/diagnosticMessages.generated.json

Large diffs are not rendered by default.

30 changes: 25 additions & 5 deletions lib/tsc.js
Expand Up @@ -60,7 +60,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
var ts;
(function (ts) {
ts.versionMajorMinor = "3.5";
ts.version = ts.versionMajorMinor + ".1";
ts.version = ts.versionMajorMinor + ".2";
})(ts || (ts = {}));
(function (ts) {
ts.emptyArray = [];
Expand Down Expand Up @@ -36124,6 +36124,17 @@ var ts;
}
return result;
}
function propagateSidebandVarianceFlags(typeArguments, variances) {
for (var i = 0; i < variances.length; i++) {
var v = variances[i];
if (v & 8) {
instantiateType(typeArguments[i], reportUnmeasurableMarkers);
}
if (v & 16) {
instantiateType(typeArguments[i], reportUnreliableMarkers);
}
}
}
function recursiveTypeRelatedTo(source, target, reportErrors, isIntersectionConstituent) {
if (overflow) {
return 0;
Expand All @@ -36134,6 +36145,15 @@ var ts;
if (reportErrors && related === 2) {
}
else {
if (outofbandVarianceMarkerHandler) {
if (source.flags & (524288 | 16777216) && source.aliasSymbol &&
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) {
propagateSidebandVarianceFlags(source.aliasTypeArguments, getAliasVariances(source.aliasSymbol));
}
if (ts.getObjectFlags(source) & 4 && ts.getObjectFlags(target) & 4 && source.target === target.target && ts.length(source.typeArguments)) {
propagateSidebandVarianceFlags(source.typeArguments, getVariances(source.target));
}
}
return related === 1 ? -1 : 0;
}
}
Expand Down Expand Up @@ -37030,10 +37050,6 @@ var ts;
if (unreliable) {
variance |= 16;
}
var covariantID = getRelationKey(typeWithSub, typeWithSuper, assignableRelation);
var contravariantID = getRelationKey(typeWithSuper, typeWithSub, assignableRelation);
assignableRelation.delete(covariantID);
assignableRelation.delete(contravariantID);
}
variances.push(variance);
};
Expand Down Expand Up @@ -76485,6 +76501,9 @@ var ts;
else {
if (isPathIgnored(fileOrDirectoryPath))
return false;
if (resolutionHost.fileIsOpen(fileOrDirectoryPath)) {
return false;
}
var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath);
if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || isNodeModulesDirectory(fileOrDirectoryPath) ||
isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) {
Expand Down Expand Up @@ -77311,6 +77330,7 @@ var ts;
hasChangedAutomaticTypeDirectiveNames = true;
scheduleProgramUpdate();
};
compilerHost.fileIsOpen = ts.returnFalse;
compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation;
compilerHost.getCurrentProgram = getCurrentProgram;
compilerHost.writeLog = writeLog;
Expand Down
44 changes: 36 additions & 8 deletions lib/tsserver.js
Expand Up @@ -87,7 +87,7 @@ var ts;
// If changing the text in this section, be sure to test `configureNightly` too.
ts.versionMajorMinor = "3.5";
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".1";
ts.version = ts.versionMajorMinor + ".2";
})(ts || (ts = {}));
(function (ts) {
/* @internal */
Expand Down Expand Up @@ -43316,6 +43316,17 @@ var ts;
}
return result;
}
function propagateSidebandVarianceFlags(typeArguments, variances) {
for (var i = 0; i < variances.length; i++) {
var v = variances[i];
if (v & 8 /* Unmeasurable */) {
instantiateType(typeArguments[i], reportUnmeasurableMarkers);
}
if (v & 16 /* Unreliable */) {
instantiateType(typeArguments[i], reportUnreliableMarkers);
}
}
}
// Determine if possibly recursive types are related. First, check if the result is already available in the global cache.
// Second, check if we have already started a comparison of the given two types in which case we assume the result to be true.
// Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are
Expand All @@ -43333,6 +43344,16 @@ var ts;
// as a failure, and should be updated as a reported failure by the bottom of this function.
}
else {
if (outofbandVarianceMarkerHandler) {
// We're in the middle of variance checking - integrate any unmeasurable/unreliable flags from this cached component
if (source.flags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) {
propagateSidebandVarianceFlags(source.aliasTypeArguments, getAliasVariances(source.aliasSymbol));
}
if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target && ts.length(source.typeArguments)) {
propagateSidebandVarianceFlags(source.typeArguments, getVariances(source.target));
}
}
return related === 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */;
}
}
Expand Down Expand Up @@ -44381,12 +44402,6 @@ var ts;
if (unreliable) {
variance |= 16 /* Unreliable */;
}
var covariantID = getRelationKey(typeWithSub, typeWithSuper, assignableRelation);
var contravariantID = getRelationKey(typeWithSuper, typeWithSub, assignableRelation);
// We delete the results of these checks, as we want them to actually be run, see the `Unmeasurable` variance we cache,
// And then fall back to a structural result.
assignableRelation.delete(covariantID);
assignableRelation.delete(contravariantID);
}
variances.push(variance);
};
Expand Down Expand Up @@ -93221,6 +93236,10 @@ var ts;
// If something to do with folder/file starting with "." in node_modules folder, skip it
if (isPathIgnored(fileOrDirectoryPath))
return false;
// prevent saving an open file from over-eagerly triggering invalidation
if (resolutionHost.fileIsOpen(fileOrDirectoryPath)) {
return false;
}
// Some file or directory in the watching directory is created
// Return early if it does not have any of the watching extension or not the custom failed lookup path
var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath);
Expand Down Expand Up @@ -94168,6 +94187,7 @@ var ts;
hasChangedAutomaticTypeDirectiveNames = true;
scheduleProgramUpdate();
};
compilerHost.fileIsOpen = ts.returnFalse;
compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation;
compilerHost.getCurrentProgram = getCurrentProgram;
compilerHost.writeLog = writeLog;
Expand Down Expand Up @@ -106289,7 +106309,7 @@ var ts;
? ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile)
: ts.findChildOfKind(body, 18 /* OpenBraceToken */, sourceFile);
var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile);
return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node.parent, sourceFile, /*autoCollapse*/ node.parent.kind !== 198 /* ArrowFunction */);
return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 198 /* ArrowFunction */);
}
function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) {
if (autoCollapse === void 0) { autoCollapse = false; }
Expand Down Expand Up @@ -125886,6 +125906,10 @@ var ts;
return this.getTypeAcquisition().enable ? this.projectService.typingsInstaller.globalTypingsCacheLocation : undefined;
};
/*@internal*/
Project.prototype.fileIsOpen = function (filePath) {
return this.projectService.openFiles.has(filePath);
};
/*@internal*/
Project.prototype.writeLog = function (s) {
this.projectService.logger.info(s);
};
Expand Down Expand Up @@ -127562,6 +127586,10 @@ var ts;
return this.watchFactory.watchDirectory(this.host, directory, function (fileOrDirectory) {
var fileOrDirectoryPath = _this.toPath(fileOrDirectory);
project.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
// don't trigger callback on open, existing files
if (project.fileIsOpen(fileOrDirectoryPath)) {
return;
}
if (ts.isPathIgnored(fileOrDirectoryPath))
return;
var configFilename = project.getConfigFilePath();
Expand Down
44 changes: 36 additions & 8 deletions lib/tsserverlibrary.js
Expand Up @@ -86,7 +86,7 @@ var ts;
// If changing the text in this section, be sure to test `configureNightly` too.
ts.versionMajorMinor = "3.5";
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".1";
ts.version = ts.versionMajorMinor + ".2";
})(ts || (ts = {}));
(function (ts) {
/* @internal */
Expand Down Expand Up @@ -43315,6 +43315,17 @@ var ts;
}
return result;
}
function propagateSidebandVarianceFlags(typeArguments, variances) {
for (var i = 0; i < variances.length; i++) {
var v = variances[i];
if (v & 8 /* Unmeasurable */) {
instantiateType(typeArguments[i], reportUnmeasurableMarkers);
}
if (v & 16 /* Unreliable */) {
instantiateType(typeArguments[i], reportUnreliableMarkers);
}
}
}
// Determine if possibly recursive types are related. First, check if the result is already available in the global cache.
// Second, check if we have already started a comparison of the given two types in which case we assume the result to be true.
// Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are
Expand All @@ -43332,6 +43343,16 @@ var ts;
// as a failure, and should be updated as a reported failure by the bottom of this function.
}
else {
if (outofbandVarianceMarkerHandler) {
// We're in the middle of variance checking - integrate any unmeasurable/unreliable flags from this cached component
if (source.flags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) {
propagateSidebandVarianceFlags(source.aliasTypeArguments, getAliasVariances(source.aliasSymbol));
}
if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target && ts.length(source.typeArguments)) {
propagateSidebandVarianceFlags(source.typeArguments, getVariances(source.target));
}
}
return related === 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */;
}
}
Expand Down Expand Up @@ -44380,12 +44401,6 @@ var ts;
if (unreliable) {
variance |= 16 /* Unreliable */;
}
var covariantID = getRelationKey(typeWithSub, typeWithSuper, assignableRelation);
var contravariantID = getRelationKey(typeWithSuper, typeWithSub, assignableRelation);
// We delete the results of these checks, as we want them to actually be run, see the `Unmeasurable` variance we cache,
// And then fall back to a structural result.
assignableRelation.delete(covariantID);
assignableRelation.delete(contravariantID);
}
variances.push(variance);
};
Expand Down Expand Up @@ -93220,6 +93235,10 @@ var ts;
// If something to do with folder/file starting with "." in node_modules folder, skip it
if (isPathIgnored(fileOrDirectoryPath))
return false;
// prevent saving an open file from over-eagerly triggering invalidation
if (resolutionHost.fileIsOpen(fileOrDirectoryPath)) {
return false;
}
// Some file or directory in the watching directory is created
// Return early if it does not have any of the watching extension or not the custom failed lookup path
var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath);
Expand Down Expand Up @@ -94167,6 +94186,7 @@ var ts;
hasChangedAutomaticTypeDirectiveNames = true;
scheduleProgramUpdate();
};
compilerHost.fileIsOpen = ts.returnFalse;
compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation;
compilerHost.getCurrentProgram = getCurrentProgram;
compilerHost.writeLog = writeLog;
Expand Down Expand Up @@ -106632,7 +106652,7 @@ var ts;
? ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile)
: ts.findChildOfKind(body, 18 /* OpenBraceToken */, sourceFile);
var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile);
return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node.parent, sourceFile, /*autoCollapse*/ node.parent.kind !== 198 /* ArrowFunction */);
return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 198 /* ArrowFunction */);
}
function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) {
if (autoCollapse === void 0) { autoCollapse = false; }
Expand Down Expand Up @@ -125885,6 +125905,10 @@ var ts;
return this.getTypeAcquisition().enable ? this.projectService.typingsInstaller.globalTypingsCacheLocation : undefined;
};
/*@internal*/
Project.prototype.fileIsOpen = function (filePath) {
return this.projectService.openFiles.has(filePath);
};
/*@internal*/
Project.prototype.writeLog = function (s) {
this.projectService.logger.info(s);
};
Expand Down Expand Up @@ -127561,6 +127585,10 @@ var ts;
return this.watchFactory.watchDirectory(this.host, directory, function (fileOrDirectory) {
var fileOrDirectoryPath = _this.toPath(fileOrDirectory);
project.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
// don't trigger callback on open, existing files
if (project.fileIsOpen(fileOrDirectoryPath)) {
return;
}
if (ts.isPathIgnored(fileOrDirectoryPath))
return;
var configFilename = project.getConfigFilePath();
Expand Down

0 comments on commit 7f47a08

Please sign in to comment.