Skip to content

Commit 7f47a08

Browse files
author
Benjamin Lichtman
committed
Update LKG
1 parent fbe2f2f commit 7f47a08

7 files changed

+250
-114
lines changed

lib/ko/diagnosticMessages.generated.json

+70-70
Large diffs are not rendered by default.

lib/tsc.js

+25-5
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
6060
var ts;
6161
(function (ts) {
6262
ts.versionMajorMinor = "3.5";
63-
ts.version = ts.versionMajorMinor + ".1";
63+
ts.version = ts.versionMajorMinor + ".2";
6464
})(ts || (ts = {}));
6565
(function (ts) {
6666
ts.emptyArray = [];
@@ -36124,6 +36124,17 @@ var ts;
3612436124
}
3612536125
return result;
3612636126
}
36127+
function propagateSidebandVarianceFlags(typeArguments, variances) {
36128+
for (var i = 0; i < variances.length; i++) {
36129+
var v = variances[i];
36130+
if (v & 8) {
36131+
instantiateType(typeArguments[i], reportUnmeasurableMarkers);
36132+
}
36133+
if (v & 16) {
36134+
instantiateType(typeArguments[i], reportUnreliableMarkers);
36135+
}
36136+
}
36137+
}
3612736138
function recursiveTypeRelatedTo(source, target, reportErrors, isIntersectionConstituent) {
3612836139
if (overflow) {
3612936140
return 0;
@@ -36134,6 +36145,15 @@ var ts;
3613436145
if (reportErrors && related === 2) {
3613536146
}
3613636147
else {
36148+
if (outofbandVarianceMarkerHandler) {
36149+
if (source.flags & (524288 | 16777216) && source.aliasSymbol &&
36150+
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) {
36151+
propagateSidebandVarianceFlags(source.aliasTypeArguments, getAliasVariances(source.aliasSymbol));
36152+
}
36153+
if (ts.getObjectFlags(source) & 4 && ts.getObjectFlags(target) & 4 && source.target === target.target && ts.length(source.typeArguments)) {
36154+
propagateSidebandVarianceFlags(source.typeArguments, getVariances(source.target));
36155+
}
36156+
}
3613736157
return related === 1 ? -1 : 0;
3613836158
}
3613936159
}
@@ -37030,10 +37050,6 @@ var ts;
3703037050
if (unreliable) {
3703137051
variance |= 16;
3703237052
}
37033-
var covariantID = getRelationKey(typeWithSub, typeWithSuper, assignableRelation);
37034-
var contravariantID = getRelationKey(typeWithSuper, typeWithSub, assignableRelation);
37035-
assignableRelation.delete(covariantID);
37036-
assignableRelation.delete(contravariantID);
3703737053
}
3703837054
variances.push(variance);
3703937055
};
@@ -76485,6 +76501,9 @@ var ts;
7648576501
else {
7648676502
if (isPathIgnored(fileOrDirectoryPath))
7648776503
return false;
76504+
if (resolutionHost.fileIsOpen(fileOrDirectoryPath)) {
76505+
return false;
76506+
}
7648876507
var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath);
7648976508
if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || isNodeModulesDirectory(fileOrDirectoryPath) ||
7649076509
isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) {
@@ -77311,6 +77330,7 @@ var ts;
7731177330
hasChangedAutomaticTypeDirectiveNames = true;
7731277331
scheduleProgramUpdate();
7731377332
};
77333+
compilerHost.fileIsOpen = ts.returnFalse;
7731477334
compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation;
7731577335
compilerHost.getCurrentProgram = getCurrentProgram;
7731677336
compilerHost.writeLog = writeLog;

lib/tsserver.js

+36-8
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ var ts;
8787
// If changing the text in this section, be sure to test `configureNightly` too.
8888
ts.versionMajorMinor = "3.5";
8989
/** The version of the TypeScript compiler release */
90-
ts.version = ts.versionMajorMinor + ".1";
90+
ts.version = ts.versionMajorMinor + ".2";
9191
})(ts || (ts = {}));
9292
(function (ts) {
9393
/* @internal */
@@ -43316,6 +43316,17 @@ var ts;
4331643316
}
4331743317
return result;
4331843318
}
43319+
function propagateSidebandVarianceFlags(typeArguments, variances) {
43320+
for (var i = 0; i < variances.length; i++) {
43321+
var v = variances[i];
43322+
if (v & 8 /* Unmeasurable */) {
43323+
instantiateType(typeArguments[i], reportUnmeasurableMarkers);
43324+
}
43325+
if (v & 16 /* Unreliable */) {
43326+
instantiateType(typeArguments[i], reportUnreliableMarkers);
43327+
}
43328+
}
43329+
}
4331943330
// Determine if possibly recursive types are related. First, check if the result is already available in the global cache.
4332043331
// Second, check if we have already started a comparison of the given two types in which case we assume the result to be true.
4332143332
// Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are
@@ -43333,6 +43344,16 @@ var ts;
4333343344
// as a failure, and should be updated as a reported failure by the bottom of this function.
4333443345
}
4333543346
else {
43347+
if (outofbandVarianceMarkerHandler) {
43348+
// We're in the middle of variance checking - integrate any unmeasurable/unreliable flags from this cached component
43349+
if (source.flags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
43350+
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) {
43351+
propagateSidebandVarianceFlags(source.aliasTypeArguments, getAliasVariances(source.aliasSymbol));
43352+
}
43353+
if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target && ts.length(source.typeArguments)) {
43354+
propagateSidebandVarianceFlags(source.typeArguments, getVariances(source.target));
43355+
}
43356+
}
4333643357
return related === 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */;
4333743358
}
4333843359
}
@@ -44381,12 +44402,6 @@ var ts;
4438144402
if (unreliable) {
4438244403
variance |= 16 /* Unreliable */;
4438344404
}
44384-
var covariantID = getRelationKey(typeWithSub, typeWithSuper, assignableRelation);
44385-
var contravariantID = getRelationKey(typeWithSuper, typeWithSub, assignableRelation);
44386-
// We delete the results of these checks, as we want them to actually be run, see the `Unmeasurable` variance we cache,
44387-
// And then fall back to a structural result.
44388-
assignableRelation.delete(covariantID);
44389-
assignableRelation.delete(contravariantID);
4439044405
}
4439144406
variances.push(variance);
4439244407
};
@@ -93221,6 +93236,10 @@ var ts;
9322193236
// If something to do with folder/file starting with "." in node_modules folder, skip it
9322293237
if (isPathIgnored(fileOrDirectoryPath))
9322393238
return false;
93239+
// prevent saving an open file from over-eagerly triggering invalidation
93240+
if (resolutionHost.fileIsOpen(fileOrDirectoryPath)) {
93241+
return false;
93242+
}
9322493243
// Some file or directory in the watching directory is created
9322593244
// Return early if it does not have any of the watching extension or not the custom failed lookup path
9322693245
var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath);
@@ -94168,6 +94187,7 @@ var ts;
9416894187
hasChangedAutomaticTypeDirectiveNames = true;
9416994188
scheduleProgramUpdate();
9417094189
};
94190+
compilerHost.fileIsOpen = ts.returnFalse;
9417194191
compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation;
9417294192
compilerHost.getCurrentProgram = getCurrentProgram;
9417394193
compilerHost.writeLog = writeLog;
@@ -106289,7 +106309,7 @@ var ts;
106289106309
? ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile)
106290106310
: ts.findChildOfKind(body, 18 /* OpenBraceToken */, sourceFile);
106291106311
var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile);
106292-
return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node.parent, sourceFile, /*autoCollapse*/ node.parent.kind !== 198 /* ArrowFunction */);
106312+
return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 198 /* ArrowFunction */);
106293106313
}
106294106314
function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) {
106295106315
if (autoCollapse === void 0) { autoCollapse = false; }
@@ -125886,6 +125906,10 @@ var ts;
125886125906
return this.getTypeAcquisition().enable ? this.projectService.typingsInstaller.globalTypingsCacheLocation : undefined;
125887125907
};
125888125908
/*@internal*/
125909+
Project.prototype.fileIsOpen = function (filePath) {
125910+
return this.projectService.openFiles.has(filePath);
125911+
};
125912+
/*@internal*/
125889125913
Project.prototype.writeLog = function (s) {
125890125914
this.projectService.logger.info(s);
125891125915
};
@@ -127562,6 +127586,10 @@ var ts;
127562127586
return this.watchFactory.watchDirectory(this.host, directory, function (fileOrDirectory) {
127563127587
var fileOrDirectoryPath = _this.toPath(fileOrDirectory);
127564127588
project.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
127589+
// don't trigger callback on open, existing files
127590+
if (project.fileIsOpen(fileOrDirectoryPath)) {
127591+
return;
127592+
}
127565127593
if (ts.isPathIgnored(fileOrDirectoryPath))
127566127594
return;
127567127595
var configFilename = project.getConfigFilePath();

lib/tsserverlibrary.js

+36-8
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var ts;
8686
// If changing the text in this section, be sure to test `configureNightly` too.
8787
ts.versionMajorMinor = "3.5";
8888
/** The version of the TypeScript compiler release */
89-
ts.version = ts.versionMajorMinor + ".1";
89+
ts.version = ts.versionMajorMinor + ".2";
9090
})(ts || (ts = {}));
9191
(function (ts) {
9292
/* @internal */
@@ -43315,6 +43315,17 @@ var ts;
4331543315
}
4331643316
return result;
4331743317
}
43318+
function propagateSidebandVarianceFlags(typeArguments, variances) {
43319+
for (var i = 0; i < variances.length; i++) {
43320+
var v = variances[i];
43321+
if (v & 8 /* Unmeasurable */) {
43322+
instantiateType(typeArguments[i], reportUnmeasurableMarkers);
43323+
}
43324+
if (v & 16 /* Unreliable */) {
43325+
instantiateType(typeArguments[i], reportUnreliableMarkers);
43326+
}
43327+
}
43328+
}
4331843329
// Determine if possibly recursive types are related. First, check if the result is already available in the global cache.
4331943330
// Second, check if we have already started a comparison of the given two types in which case we assume the result to be true.
4332043331
// Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are
@@ -43332,6 +43343,16 @@ var ts;
4333243343
// as a failure, and should be updated as a reported failure by the bottom of this function.
4333343344
}
4333443345
else {
43346+
if (outofbandVarianceMarkerHandler) {
43347+
// We're in the middle of variance checking - integrate any unmeasurable/unreliable flags from this cached component
43348+
if (source.flags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
43349+
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) {
43350+
propagateSidebandVarianceFlags(source.aliasTypeArguments, getAliasVariances(source.aliasSymbol));
43351+
}
43352+
if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target && ts.length(source.typeArguments)) {
43353+
propagateSidebandVarianceFlags(source.typeArguments, getVariances(source.target));
43354+
}
43355+
}
4333543356
return related === 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */;
4333643357
}
4333743358
}
@@ -44380,12 +44401,6 @@ var ts;
4438044401
if (unreliable) {
4438144402
variance |= 16 /* Unreliable */;
4438244403
}
44383-
var covariantID = getRelationKey(typeWithSub, typeWithSuper, assignableRelation);
44384-
var contravariantID = getRelationKey(typeWithSuper, typeWithSub, assignableRelation);
44385-
// We delete the results of these checks, as we want them to actually be run, see the `Unmeasurable` variance we cache,
44386-
// And then fall back to a structural result.
44387-
assignableRelation.delete(covariantID);
44388-
assignableRelation.delete(contravariantID);
4438944404
}
4439044405
variances.push(variance);
4439144406
};
@@ -93220,6 +93235,10 @@ var ts;
9322093235
// If something to do with folder/file starting with "." in node_modules folder, skip it
9322193236
if (isPathIgnored(fileOrDirectoryPath))
9322293237
return false;
93238+
// prevent saving an open file from over-eagerly triggering invalidation
93239+
if (resolutionHost.fileIsOpen(fileOrDirectoryPath)) {
93240+
return false;
93241+
}
9322393242
// Some file or directory in the watching directory is created
9322493243
// Return early if it does not have any of the watching extension or not the custom failed lookup path
9322593244
var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath);
@@ -94167,6 +94186,7 @@ var ts;
9416794186
hasChangedAutomaticTypeDirectiveNames = true;
9416894187
scheduleProgramUpdate();
9416994188
};
94189+
compilerHost.fileIsOpen = ts.returnFalse;
9417094190
compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation;
9417194191
compilerHost.getCurrentProgram = getCurrentProgram;
9417294192
compilerHost.writeLog = writeLog;
@@ -106632,7 +106652,7 @@ var ts;
106632106652
? ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile)
106633106653
: ts.findChildOfKind(body, 18 /* OpenBraceToken */, sourceFile);
106634106654
var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile);
106635-
return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node.parent, sourceFile, /*autoCollapse*/ node.parent.kind !== 198 /* ArrowFunction */);
106655+
return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 198 /* ArrowFunction */);
106636106656
}
106637106657
function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) {
106638106658
if (autoCollapse === void 0) { autoCollapse = false; }
@@ -125885,6 +125905,10 @@ var ts;
125885125905
return this.getTypeAcquisition().enable ? this.projectService.typingsInstaller.globalTypingsCacheLocation : undefined;
125886125906
};
125887125907
/*@internal*/
125908+
Project.prototype.fileIsOpen = function (filePath) {
125909+
return this.projectService.openFiles.has(filePath);
125910+
};
125911+
/*@internal*/
125888125912
Project.prototype.writeLog = function (s) {
125889125913
this.projectService.logger.info(s);
125890125914
};
@@ -127561,6 +127585,10 @@ var ts;
127561127585
return this.watchFactory.watchDirectory(this.host, directory, function (fileOrDirectory) {
127562127586
var fileOrDirectoryPath = _this.toPath(fileOrDirectory);
127563127587
project.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
127588+
// don't trigger callback on open, existing files
127589+
if (project.fileIsOpen(fileOrDirectoryPath)) {
127590+
return;
127591+
}
127564127592
if (ts.isPathIgnored(fileOrDirectoryPath))
127565127593
return;
127566127594
var configFilename = project.getConfigFilePath();

0 commit comments

Comments
 (0)