Skip to content
Permalink
Browse files

Update LKG

  • Loading branch information...
uniqueiniquity committed Jun 12, 2019
1 parent fbe2f2f commit 7f47a08a5e9874f0f97a667bd81eebddec61247c
Showing with 250 additions and 114 deletions.
  1. +70 −70 lib/ko/diagnosticMessages.generated.json
  2. +25 −5 lib/tsc.js
  3. +36 −8 lib/tsserver.js
  4. +36 −8 lib/tsserverlibrary.js
  5. +28 −8 lib/typescript.js
  6. +28 −8 lib/typescriptServices.js
  7. +27 −7 lib/typingsInstaller.js

Large diffs are not rendered by default.

@@ -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 = [];
}
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;
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;
}
}
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);
};
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)) {
hasChangedAutomaticTypeDirectiveNames = true;
scheduleProgramUpdate();
};
compilerHost.fileIsOpen = ts.returnFalse;
compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation;
compilerHost.getCurrentProgram = getCurrentProgram;
compilerHost.writeLog = writeLog;
@@ -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 */
@@ -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
@@ -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 */;
}
}
@@ -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);
};
@@ -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);
@@ -94168,6 +94187,7 @@ var ts;
hasChangedAutomaticTypeDirectiveNames = true;
scheduleProgramUpdate();
};
compilerHost.fileIsOpen = ts.returnFalse;
compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation;
compilerHost.getCurrentProgram = getCurrentProgram;
compilerHost.writeLog = writeLog;
@@ -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; }
@@ -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);
};
@@ -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();
@@ -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 */
@@ -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
@@ -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 */;
}
}
@@ -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);
};
@@ -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);
@@ -94167,6 +94186,7 @@ var ts;
hasChangedAutomaticTypeDirectiveNames = true;
scheduleProgramUpdate();
};
compilerHost.fileIsOpen = ts.returnFalse;
compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation;
compilerHost.getCurrentProgram = getCurrentProgram;
compilerHost.writeLog = writeLog;
@@ -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; }
@@ -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);
};
@@ -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();

0 comments on commit 7f47a08

Please sign in to comment.
You can’t perform that action at this time.