typescript 4.9.0-dev.20220926 → 4.9.0-dev.20220928
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +21 -6
- package/lib/tsserver.js +50 -21
- package/lib/tsserverlibrary.js +50 -21
- package/lib/typescript.js +35 -6
- package/lib/typescriptServices.js +35 -6
- package/lib/typingsInstaller.js +35 -6
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.9";
|
|
72
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
72
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220928");
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -52722,7 +52722,15 @@ var ts;
|
|
|
52722
52722
|
return accessFlags & 1 ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
|
|
52723
52723
|
}
|
|
52724
52724
|
errorIfWritingToReadonlyIndex(indexInfo);
|
|
52725
|
-
|
|
52725
|
+
if ((accessFlags & 1) &&
|
|
52726
|
+
!(objectType.symbol &&
|
|
52727
|
+
objectType.symbol.flags & (256 | 128) &&
|
|
52728
|
+
(indexType.symbol &&
|
|
52729
|
+
indexType.flags & 1024 &&
|
|
52730
|
+
getParentOfSymbol(indexType.symbol) === objectType.symbol))) {
|
|
52731
|
+
return getUnionType([indexInfo.type, undefinedType]);
|
|
52732
|
+
}
|
|
52733
|
+
return indexInfo.type;
|
|
52726
52734
|
}
|
|
52727
52735
|
if (indexType.flags & 131072) {
|
|
52728
52736
|
return neverType;
|
|
@@ -59126,7 +59134,7 @@ var ts;
|
|
|
59126
59134
|
}
|
|
59127
59135
|
if (ts.isEntityNameExpression(node.argumentExpression)) {
|
|
59128
59136
|
var symbol = resolveEntityName(node.argumentExpression, 111551, true);
|
|
59129
|
-
if (!symbol || !isConstVariable(symbol))
|
|
59137
|
+
if (!symbol || !(isConstVariable(symbol) || (symbol.flags & 8)))
|
|
59130
59138
|
return undefined;
|
|
59131
59139
|
var declaration = symbol.valueDeclaration;
|
|
59132
59140
|
if (declaration === undefined)
|
|
@@ -59140,7 +59148,12 @@ var ts;
|
|
|
59140
59148
|
}
|
|
59141
59149
|
if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
|
|
59142
59150
|
var initializer = ts.getEffectiveInitializer(declaration);
|
|
59143
|
-
|
|
59151
|
+
if (initializer) {
|
|
59152
|
+
return tryGetNameFromType(getTypeOfExpression(initializer));
|
|
59153
|
+
}
|
|
59154
|
+
if (ts.isEnumMember(declaration)) {
|
|
59155
|
+
return ts.getTextOfPropertyName(declaration.name);
|
|
59156
|
+
}
|
|
59144
59157
|
}
|
|
59145
59158
|
}
|
|
59146
59159
|
return undefined;
|
|
@@ -101566,7 +101579,7 @@ var ts;
|
|
|
101566
101579
|
var canCopyEmitSignatures = compilerOptions.composite &&
|
|
101567
101580
|
(oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
|
|
101568
101581
|
!outFilePath &&
|
|
101569
|
-
!ts.compilerOptionsAffectDeclarationPath(compilerOptions,
|
|
101582
|
+
!ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
|
|
101570
101583
|
if (useOldState) {
|
|
101571
101584
|
(_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
|
|
101572
101585
|
if (!outFilePath && oldState.affectedFilesPendingEmit) {
|
|
@@ -106380,7 +106393,9 @@ var ts;
|
|
|
106380
106393
|
}
|
|
106381
106394
|
if (buildInfo.program) {
|
|
106382
106395
|
if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
106383
|
-
(!project.options.noEmit
|
|
106396
|
+
(!project.options.noEmit ?
|
|
106397
|
+
(_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
|
|
106398
|
+
ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
|
|
106384
106399
|
return {
|
|
106385
106400
|
type: ts.UpToDateStatusType.OutOfDateBuildInfo,
|
|
106386
106401
|
buildInfoFile: buildInfoPath
|
package/lib/tsserver.js
CHANGED
|
@@ -109,7 +109,7 @@ var ts;
|
|
|
109
109
|
// The following is baselined as a literal template type without intervention
|
|
110
110
|
/** The version of the TypeScript compiler release */
|
|
111
111
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
112
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
112
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220928");
|
|
113
113
|
/* @internal */
|
|
114
114
|
var Comparison;
|
|
115
115
|
(function (Comparison) {
|
|
@@ -63343,7 +63343,18 @@ var ts;
|
|
|
63343
63343
|
return accessFlags & 1 /* AccessFlags.IncludeUndefined */ ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
|
|
63344
63344
|
}
|
|
63345
63345
|
errorIfWritingToReadonlyIndex(indexInfo);
|
|
63346
|
-
|
|
63346
|
+
// When accessing an enum object with its own type,
|
|
63347
|
+
// e.g. E[E.A] for enum E { A }, undefined shouldn't
|
|
63348
|
+
// be included in the result type
|
|
63349
|
+
if ((accessFlags & 1 /* AccessFlags.IncludeUndefined */) &&
|
|
63350
|
+
!(objectType.symbol &&
|
|
63351
|
+
objectType.symbol.flags & (256 /* SymbolFlags.RegularEnum */ | 128 /* SymbolFlags.ConstEnum */) &&
|
|
63352
|
+
(indexType.symbol &&
|
|
63353
|
+
indexType.flags & 1024 /* TypeFlags.EnumLiteral */ &&
|
|
63354
|
+
getParentOfSymbol(indexType.symbol) === objectType.symbol))) {
|
|
63355
|
+
return getUnionType([indexInfo.type, undefinedType]);
|
|
63356
|
+
}
|
|
63357
|
+
return indexInfo.type;
|
|
63347
63358
|
}
|
|
63348
63359
|
if (indexType.flags & 131072 /* TypeFlags.Never */) {
|
|
63349
63360
|
return neverType;
|
|
@@ -70762,7 +70773,7 @@ var ts;
|
|
|
70762
70773
|
}
|
|
70763
70774
|
if (ts.isEntityNameExpression(node.argumentExpression)) {
|
|
70764
70775
|
var symbol = resolveEntityName(node.argumentExpression, 111551 /* SymbolFlags.Value */, /*ignoreErrors*/ true);
|
|
70765
|
-
if (!symbol || !isConstVariable(symbol))
|
|
70776
|
+
if (!symbol || !(isConstVariable(symbol) || (symbol.flags & 8 /* SymbolFlags.EnumMember */)))
|
|
70766
70777
|
return undefined;
|
|
70767
70778
|
var declaration = symbol.valueDeclaration;
|
|
70768
70779
|
if (declaration === undefined)
|
|
@@ -70776,7 +70787,12 @@ var ts;
|
|
|
70776
70787
|
}
|
|
70777
70788
|
if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
|
|
70778
70789
|
var initializer = ts.getEffectiveInitializer(declaration);
|
|
70779
|
-
|
|
70790
|
+
if (initializer) {
|
|
70791
|
+
return tryGetNameFromType(getTypeOfExpression(initializer));
|
|
70792
|
+
}
|
|
70793
|
+
if (ts.isEnumMember(declaration)) {
|
|
70794
|
+
return ts.getTextOfPropertyName(declaration.name);
|
|
70795
|
+
}
|
|
70780
70796
|
}
|
|
70781
70797
|
}
|
|
70782
70798
|
return undefined;
|
|
@@ -122541,10 +122557,16 @@ var ts;
|
|
|
122541
122557
|
var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
|
|
122542
122558
|
var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
|
|
122543
122559
|
!ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
|
|
122560
|
+
// We can only reuse emit signatures (i.e. .d.ts signatures) if the .d.ts file is unchanged,
|
|
122561
|
+
// which will eg be depedent on change in options like declarationDir and outDir options are unchanged.
|
|
122562
|
+
// We need to look in oldState.compilerOptions, rather than oldCompilerOptions (i.e.we need to disregard useOldState) because
|
|
122563
|
+
// oldCompilerOptions can be undefined if there was change in say module from None to some other option
|
|
122564
|
+
// which would make useOldState as false since we can now use reference maps that are needed to track what to emit, what to check etc
|
|
122565
|
+
// but that option change does not affect d.ts file name so emitSignatures should still be reused.
|
|
122544
122566
|
var canCopyEmitSignatures = compilerOptions.composite &&
|
|
122545
122567
|
(oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
|
|
122546
122568
|
!outFilePath &&
|
|
122547
|
-
!ts.compilerOptionsAffectDeclarationPath(compilerOptions,
|
|
122569
|
+
!ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
|
|
122548
122570
|
if (useOldState) {
|
|
122549
122571
|
// Copy old state's changed files set
|
|
122550
122572
|
(_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
|
|
@@ -127979,8 +128001,15 @@ var ts;
|
|
|
127979
128001
|
}
|
|
127980
128002
|
if (buildInfo.program) {
|
|
127981
128003
|
// If there are pending changes that are not emitted, project is out of date
|
|
128004
|
+
// When there are syntax errors, changeFileSet will have list of files changed (irrespective of noEmit)
|
|
128005
|
+
// But in case of semantic error we need special treatment.
|
|
128006
|
+
// Checking presence of affectedFilesPendingEmit list is fast and good way to tell if there were semantic errors and file emit was blocked
|
|
128007
|
+
// But if noEmit is true, affectedFilesPendingEmit will have file list even if there are no semantic errors to preserve list of files to be emitted when running with noEmit false
|
|
128008
|
+
// So with noEmit set to true, check on semantic diagnostics needs to be explicit as oppose to when it is false when only files pending emit is sufficient
|
|
127982
128009
|
if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
127983
|
-
(!project.options.noEmit
|
|
128010
|
+
(!project.options.noEmit ?
|
|
128011
|
+
(_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
|
|
128012
|
+
ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
|
|
127984
128013
|
return {
|
|
127985
128014
|
type: ts.UpToDateStatusType.OutOfDateBuildInfo,
|
|
127986
128015
|
buildInfoFile: buildInfoPath
|
|
@@ -175694,18 +175723,20 @@ var ts;
|
|
|
175694
175723
|
return ensureProject ? this.ensureDefaultProjectForFile(fileName) : this.tryGetDefaultProjectForFile(fileName);
|
|
175695
175724
|
};
|
|
175696
175725
|
/* @internal */
|
|
175697
|
-
ProjectService.prototype.tryGetDefaultProjectForFile = function (
|
|
175698
|
-
var scriptInfo = this.getScriptInfoForNormalizedPath(
|
|
175726
|
+
ProjectService.prototype.tryGetDefaultProjectForFile = function (fileNameOrScriptInfo) {
|
|
175727
|
+
var scriptInfo = ts.isString(fileNameOrScriptInfo) ? this.getScriptInfoForNormalizedPath(fileNameOrScriptInfo) : fileNameOrScriptInfo;
|
|
175699
175728
|
return scriptInfo && !scriptInfo.isOrphan() ? scriptInfo.getDefaultProject() : undefined;
|
|
175700
175729
|
};
|
|
175701
175730
|
/* @internal */
|
|
175702
|
-
ProjectService.prototype.ensureDefaultProjectForFile = function (
|
|
175703
|
-
return this.tryGetDefaultProjectForFile(
|
|
175731
|
+
ProjectService.prototype.ensureDefaultProjectForFile = function (fileNameOrScriptInfo) {
|
|
175732
|
+
return this.tryGetDefaultProjectForFile(fileNameOrScriptInfo) || this.doEnsureDefaultProjectForFile(fileNameOrScriptInfo);
|
|
175704
175733
|
};
|
|
175705
|
-
ProjectService.prototype.doEnsureDefaultProjectForFile = function (
|
|
175734
|
+
ProjectService.prototype.doEnsureDefaultProjectForFile = function (fileNameOrScriptInfo) {
|
|
175706
175735
|
this.ensureProjectStructuresUptoDate();
|
|
175707
|
-
var scriptInfo = this.getScriptInfoForNormalizedPath(
|
|
175708
|
-
return scriptInfo ?
|
|
175736
|
+
var scriptInfo = ts.isString(fileNameOrScriptInfo) ? this.getScriptInfoForNormalizedPath(fileNameOrScriptInfo) : fileNameOrScriptInfo;
|
|
175737
|
+
return scriptInfo ?
|
|
175738
|
+
scriptInfo.getDefaultProject() :
|
|
175739
|
+
(this.logErrorForScriptInfoNotFound(ts.isString(fileNameOrScriptInfo) ? fileNameOrScriptInfo : fileNameOrScriptInfo.fileName), server.Errors.ThrowNoProject());
|
|
175709
175740
|
};
|
|
175710
175741
|
ProjectService.prototype.getScriptInfoEnsuringProjectsUptoDate = function (uncheckedFileName) {
|
|
175711
175742
|
this.ensureProjectStructuresUptoDate();
|
|
@@ -177877,7 +177908,7 @@ var ts;
|
|
|
177877
177908
|
if (this.serverMode !== ts.LanguageServiceMode.Semantic || !this.eventHandler || !scriptInfo.isJavaScript() || !ts.addToSeen(this.allJsFilesForOpenFileTelemetry, scriptInfo.path)) {
|
|
177878
177909
|
return;
|
|
177879
177910
|
}
|
|
177880
|
-
var project =
|
|
177911
|
+
var project = this.ensureDefaultProjectForFile(scriptInfo);
|
|
177881
177912
|
if (!project.languageServiceEnabled) {
|
|
177882
177913
|
return;
|
|
177883
177914
|
}
|
|
@@ -180477,6 +180508,10 @@ var ts;
|
|
|
180477
180508
|
this.projectService.logErrorForScriptInfoNotFound(args.file);
|
|
180478
180509
|
return server.Errors.ThrowNoProject();
|
|
180479
180510
|
}
|
|
180511
|
+
else if (!getScriptInfoEnsuringProjectsUptoDate) {
|
|
180512
|
+
// Ensure there are containing projects are present
|
|
180513
|
+
this.projectService.ensureDefaultProjectForFile(scriptInfo);
|
|
180514
|
+
}
|
|
180480
180515
|
projects = scriptInfo.containingProjects;
|
|
180481
180516
|
symLinkedProjects = this.projectService.getSymlinkedProjects(scriptInfo);
|
|
180482
180517
|
}
|
|
@@ -180603,13 +180638,7 @@ var ts;
|
|
|
180603
180638
|
return this.getFileAndProjectWorker(args.file, args.projectFileName);
|
|
180604
180639
|
};
|
|
180605
180640
|
Session.prototype.getFileAndLanguageServiceForSyntacticOperation = function (args) {
|
|
180606
|
-
|
|
180607
|
-
// throw if we dont get project
|
|
180608
|
-
var file = server.toNormalizedPath(args.file);
|
|
180609
|
-
var project = this.getProject(args.projectFileName) || this.projectService.ensureDefaultProjectForFile(file);
|
|
180610
|
-
if (!project) {
|
|
180611
|
-
return server.Errors.ThrowNoProject();
|
|
180612
|
-
}
|
|
180641
|
+
var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
|
|
180613
180642
|
return {
|
|
180614
180643
|
file: file,
|
|
180615
180644
|
languageService: project.getLanguageService(/*ensureSynchronized*/ false)
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -108,7 +108,7 @@ var ts;
|
|
|
108
108
|
// The following is baselined as a literal template type without intervention
|
|
109
109
|
/** The version of the TypeScript compiler release */
|
|
110
110
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
111
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
111
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220928");
|
|
112
112
|
/* @internal */
|
|
113
113
|
var Comparison;
|
|
114
114
|
(function (Comparison) {
|
|
@@ -63342,7 +63342,18 @@ var ts;
|
|
|
63342
63342
|
return accessFlags & 1 /* AccessFlags.IncludeUndefined */ ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
|
|
63343
63343
|
}
|
|
63344
63344
|
errorIfWritingToReadonlyIndex(indexInfo);
|
|
63345
|
-
|
|
63345
|
+
// When accessing an enum object with its own type,
|
|
63346
|
+
// e.g. E[E.A] for enum E { A }, undefined shouldn't
|
|
63347
|
+
// be included in the result type
|
|
63348
|
+
if ((accessFlags & 1 /* AccessFlags.IncludeUndefined */) &&
|
|
63349
|
+
!(objectType.symbol &&
|
|
63350
|
+
objectType.symbol.flags & (256 /* SymbolFlags.RegularEnum */ | 128 /* SymbolFlags.ConstEnum */) &&
|
|
63351
|
+
(indexType.symbol &&
|
|
63352
|
+
indexType.flags & 1024 /* TypeFlags.EnumLiteral */ &&
|
|
63353
|
+
getParentOfSymbol(indexType.symbol) === objectType.symbol))) {
|
|
63354
|
+
return getUnionType([indexInfo.type, undefinedType]);
|
|
63355
|
+
}
|
|
63356
|
+
return indexInfo.type;
|
|
63346
63357
|
}
|
|
63347
63358
|
if (indexType.flags & 131072 /* TypeFlags.Never */) {
|
|
63348
63359
|
return neverType;
|
|
@@ -70761,7 +70772,7 @@ var ts;
|
|
|
70761
70772
|
}
|
|
70762
70773
|
if (ts.isEntityNameExpression(node.argumentExpression)) {
|
|
70763
70774
|
var symbol = resolveEntityName(node.argumentExpression, 111551 /* SymbolFlags.Value */, /*ignoreErrors*/ true);
|
|
70764
|
-
if (!symbol || !isConstVariable(symbol))
|
|
70775
|
+
if (!symbol || !(isConstVariable(symbol) || (symbol.flags & 8 /* SymbolFlags.EnumMember */)))
|
|
70765
70776
|
return undefined;
|
|
70766
70777
|
var declaration = symbol.valueDeclaration;
|
|
70767
70778
|
if (declaration === undefined)
|
|
@@ -70775,7 +70786,12 @@ var ts;
|
|
|
70775
70786
|
}
|
|
70776
70787
|
if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
|
|
70777
70788
|
var initializer = ts.getEffectiveInitializer(declaration);
|
|
70778
|
-
|
|
70789
|
+
if (initializer) {
|
|
70790
|
+
return tryGetNameFromType(getTypeOfExpression(initializer));
|
|
70791
|
+
}
|
|
70792
|
+
if (ts.isEnumMember(declaration)) {
|
|
70793
|
+
return ts.getTextOfPropertyName(declaration.name);
|
|
70794
|
+
}
|
|
70779
70795
|
}
|
|
70780
70796
|
}
|
|
70781
70797
|
return undefined;
|
|
@@ -122540,10 +122556,16 @@ var ts;
|
|
|
122540
122556
|
var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
|
|
122541
122557
|
var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
|
|
122542
122558
|
!ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
|
|
122559
|
+
// We can only reuse emit signatures (i.e. .d.ts signatures) if the .d.ts file is unchanged,
|
|
122560
|
+
// which will eg be depedent on change in options like declarationDir and outDir options are unchanged.
|
|
122561
|
+
// We need to look in oldState.compilerOptions, rather than oldCompilerOptions (i.e.we need to disregard useOldState) because
|
|
122562
|
+
// oldCompilerOptions can be undefined if there was change in say module from None to some other option
|
|
122563
|
+
// which would make useOldState as false since we can now use reference maps that are needed to track what to emit, what to check etc
|
|
122564
|
+
// but that option change does not affect d.ts file name so emitSignatures should still be reused.
|
|
122543
122565
|
var canCopyEmitSignatures = compilerOptions.composite &&
|
|
122544
122566
|
(oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
|
|
122545
122567
|
!outFilePath &&
|
|
122546
|
-
!ts.compilerOptionsAffectDeclarationPath(compilerOptions,
|
|
122568
|
+
!ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
|
|
122547
122569
|
if (useOldState) {
|
|
122548
122570
|
// Copy old state's changed files set
|
|
122549
122571
|
(_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
|
|
@@ -127978,8 +128000,15 @@ var ts;
|
|
|
127978
128000
|
}
|
|
127979
128001
|
if (buildInfo.program) {
|
|
127980
128002
|
// If there are pending changes that are not emitted, project is out of date
|
|
128003
|
+
// When there are syntax errors, changeFileSet will have list of files changed (irrespective of noEmit)
|
|
128004
|
+
// But in case of semantic error we need special treatment.
|
|
128005
|
+
// Checking presence of affectedFilesPendingEmit list is fast and good way to tell if there were semantic errors and file emit was blocked
|
|
128006
|
+
// But if noEmit is true, affectedFilesPendingEmit will have file list even if there are no semantic errors to preserve list of files to be emitted when running with noEmit false
|
|
128007
|
+
// So with noEmit set to true, check on semantic diagnostics needs to be explicit as oppose to when it is false when only files pending emit is sufficient
|
|
127981
128008
|
if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
127982
|
-
(!project.options.noEmit
|
|
128009
|
+
(!project.options.noEmit ?
|
|
128010
|
+
(_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
|
|
128011
|
+
ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
|
|
127983
128012
|
return {
|
|
127984
128013
|
type: ts.UpToDateStatusType.OutOfDateBuildInfo,
|
|
127985
128014
|
buildInfoFile: buildInfoPath
|
|
@@ -175693,18 +175722,20 @@ var ts;
|
|
|
175693
175722
|
return ensureProject ? this.ensureDefaultProjectForFile(fileName) : this.tryGetDefaultProjectForFile(fileName);
|
|
175694
175723
|
};
|
|
175695
175724
|
/* @internal */
|
|
175696
|
-
ProjectService.prototype.tryGetDefaultProjectForFile = function (
|
|
175697
|
-
var scriptInfo = this.getScriptInfoForNormalizedPath(
|
|
175725
|
+
ProjectService.prototype.tryGetDefaultProjectForFile = function (fileNameOrScriptInfo) {
|
|
175726
|
+
var scriptInfo = ts.isString(fileNameOrScriptInfo) ? this.getScriptInfoForNormalizedPath(fileNameOrScriptInfo) : fileNameOrScriptInfo;
|
|
175698
175727
|
return scriptInfo && !scriptInfo.isOrphan() ? scriptInfo.getDefaultProject() : undefined;
|
|
175699
175728
|
};
|
|
175700
175729
|
/* @internal */
|
|
175701
|
-
ProjectService.prototype.ensureDefaultProjectForFile = function (
|
|
175702
|
-
return this.tryGetDefaultProjectForFile(
|
|
175730
|
+
ProjectService.prototype.ensureDefaultProjectForFile = function (fileNameOrScriptInfo) {
|
|
175731
|
+
return this.tryGetDefaultProjectForFile(fileNameOrScriptInfo) || this.doEnsureDefaultProjectForFile(fileNameOrScriptInfo);
|
|
175703
175732
|
};
|
|
175704
|
-
ProjectService.prototype.doEnsureDefaultProjectForFile = function (
|
|
175733
|
+
ProjectService.prototype.doEnsureDefaultProjectForFile = function (fileNameOrScriptInfo) {
|
|
175705
175734
|
this.ensureProjectStructuresUptoDate();
|
|
175706
|
-
var scriptInfo = this.getScriptInfoForNormalizedPath(
|
|
175707
|
-
return scriptInfo ?
|
|
175735
|
+
var scriptInfo = ts.isString(fileNameOrScriptInfo) ? this.getScriptInfoForNormalizedPath(fileNameOrScriptInfo) : fileNameOrScriptInfo;
|
|
175736
|
+
return scriptInfo ?
|
|
175737
|
+
scriptInfo.getDefaultProject() :
|
|
175738
|
+
(this.logErrorForScriptInfoNotFound(ts.isString(fileNameOrScriptInfo) ? fileNameOrScriptInfo : fileNameOrScriptInfo.fileName), server.Errors.ThrowNoProject());
|
|
175708
175739
|
};
|
|
175709
175740
|
ProjectService.prototype.getScriptInfoEnsuringProjectsUptoDate = function (uncheckedFileName) {
|
|
175710
175741
|
this.ensureProjectStructuresUptoDate();
|
|
@@ -177876,7 +177907,7 @@ var ts;
|
|
|
177876
177907
|
if (this.serverMode !== ts.LanguageServiceMode.Semantic || !this.eventHandler || !scriptInfo.isJavaScript() || !ts.addToSeen(this.allJsFilesForOpenFileTelemetry, scriptInfo.path)) {
|
|
177877
177908
|
return;
|
|
177878
177909
|
}
|
|
177879
|
-
var project =
|
|
177910
|
+
var project = this.ensureDefaultProjectForFile(scriptInfo);
|
|
177880
177911
|
if (!project.languageServiceEnabled) {
|
|
177881
177912
|
return;
|
|
177882
177913
|
}
|
|
@@ -180476,6 +180507,10 @@ var ts;
|
|
|
180476
180507
|
this.projectService.logErrorForScriptInfoNotFound(args.file);
|
|
180477
180508
|
return server.Errors.ThrowNoProject();
|
|
180478
180509
|
}
|
|
180510
|
+
else if (!getScriptInfoEnsuringProjectsUptoDate) {
|
|
180511
|
+
// Ensure there are containing projects are present
|
|
180512
|
+
this.projectService.ensureDefaultProjectForFile(scriptInfo);
|
|
180513
|
+
}
|
|
180479
180514
|
projects = scriptInfo.containingProjects;
|
|
180480
180515
|
symLinkedProjects = this.projectService.getSymlinkedProjects(scriptInfo);
|
|
180481
180516
|
}
|
|
@@ -180602,13 +180637,7 @@ var ts;
|
|
|
180602
180637
|
return this.getFileAndProjectWorker(args.file, args.projectFileName);
|
|
180603
180638
|
};
|
|
180604
180639
|
Session.prototype.getFileAndLanguageServiceForSyntacticOperation = function (args) {
|
|
180605
|
-
|
|
180606
|
-
// throw if we dont get project
|
|
180607
|
-
var file = server.toNormalizedPath(args.file);
|
|
180608
|
-
var project = this.getProject(args.projectFileName) || this.projectService.ensureDefaultProjectForFile(file);
|
|
180609
|
-
if (!project) {
|
|
180610
|
-
return server.Errors.ThrowNoProject();
|
|
180611
|
-
}
|
|
180640
|
+
var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
|
|
180612
180641
|
return {
|
|
180613
180642
|
file: file,
|
|
180614
180643
|
languageService: project.getLanguageService(/*ensureSynchronized*/ false)
|
package/lib/typescript.js
CHANGED
|
@@ -99,7 +99,7 @@ var ts;
|
|
|
99
99
|
// The following is baselined as a literal template type without intervention
|
|
100
100
|
/** The version of the TypeScript compiler release */
|
|
101
101
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
102
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
102
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220928");
|
|
103
103
|
/* @internal */
|
|
104
104
|
var Comparison;
|
|
105
105
|
(function (Comparison) {
|
|
@@ -63333,7 +63333,18 @@ var ts;
|
|
|
63333
63333
|
return accessFlags & 1 /* AccessFlags.IncludeUndefined */ ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
|
|
63334
63334
|
}
|
|
63335
63335
|
errorIfWritingToReadonlyIndex(indexInfo);
|
|
63336
|
-
|
|
63336
|
+
// When accessing an enum object with its own type,
|
|
63337
|
+
// e.g. E[E.A] for enum E { A }, undefined shouldn't
|
|
63338
|
+
// be included in the result type
|
|
63339
|
+
if ((accessFlags & 1 /* AccessFlags.IncludeUndefined */) &&
|
|
63340
|
+
!(objectType.symbol &&
|
|
63341
|
+
objectType.symbol.flags & (256 /* SymbolFlags.RegularEnum */ | 128 /* SymbolFlags.ConstEnum */) &&
|
|
63342
|
+
(indexType.symbol &&
|
|
63343
|
+
indexType.flags & 1024 /* TypeFlags.EnumLiteral */ &&
|
|
63344
|
+
getParentOfSymbol(indexType.symbol) === objectType.symbol))) {
|
|
63345
|
+
return getUnionType([indexInfo.type, undefinedType]);
|
|
63346
|
+
}
|
|
63347
|
+
return indexInfo.type;
|
|
63337
63348
|
}
|
|
63338
63349
|
if (indexType.flags & 131072 /* TypeFlags.Never */) {
|
|
63339
63350
|
return neverType;
|
|
@@ -70752,7 +70763,7 @@ var ts;
|
|
|
70752
70763
|
}
|
|
70753
70764
|
if (ts.isEntityNameExpression(node.argumentExpression)) {
|
|
70754
70765
|
var symbol = resolveEntityName(node.argumentExpression, 111551 /* SymbolFlags.Value */, /*ignoreErrors*/ true);
|
|
70755
|
-
if (!symbol || !isConstVariable(symbol))
|
|
70766
|
+
if (!symbol || !(isConstVariable(symbol) || (symbol.flags & 8 /* SymbolFlags.EnumMember */)))
|
|
70756
70767
|
return undefined;
|
|
70757
70768
|
var declaration = symbol.valueDeclaration;
|
|
70758
70769
|
if (declaration === undefined)
|
|
@@ -70766,7 +70777,12 @@ var ts;
|
|
|
70766
70777
|
}
|
|
70767
70778
|
if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
|
|
70768
70779
|
var initializer = ts.getEffectiveInitializer(declaration);
|
|
70769
|
-
|
|
70780
|
+
if (initializer) {
|
|
70781
|
+
return tryGetNameFromType(getTypeOfExpression(initializer));
|
|
70782
|
+
}
|
|
70783
|
+
if (ts.isEnumMember(declaration)) {
|
|
70784
|
+
return ts.getTextOfPropertyName(declaration.name);
|
|
70785
|
+
}
|
|
70770
70786
|
}
|
|
70771
70787
|
}
|
|
70772
70788
|
return undefined;
|
|
@@ -122531,10 +122547,16 @@ var ts;
|
|
|
122531
122547
|
var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
|
|
122532
122548
|
var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
|
|
122533
122549
|
!ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
|
|
122550
|
+
// We can only reuse emit signatures (i.e. .d.ts signatures) if the .d.ts file is unchanged,
|
|
122551
|
+
// which will eg be depedent on change in options like declarationDir and outDir options are unchanged.
|
|
122552
|
+
// We need to look in oldState.compilerOptions, rather than oldCompilerOptions (i.e.we need to disregard useOldState) because
|
|
122553
|
+
// oldCompilerOptions can be undefined if there was change in say module from None to some other option
|
|
122554
|
+
// which would make useOldState as false since we can now use reference maps that are needed to track what to emit, what to check etc
|
|
122555
|
+
// but that option change does not affect d.ts file name so emitSignatures should still be reused.
|
|
122534
122556
|
var canCopyEmitSignatures = compilerOptions.composite &&
|
|
122535
122557
|
(oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
|
|
122536
122558
|
!outFilePath &&
|
|
122537
|
-
!ts.compilerOptionsAffectDeclarationPath(compilerOptions,
|
|
122559
|
+
!ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
|
|
122538
122560
|
if (useOldState) {
|
|
122539
122561
|
// Copy old state's changed files set
|
|
122540
122562
|
(_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
|
|
@@ -127969,8 +127991,15 @@ var ts;
|
|
|
127969
127991
|
}
|
|
127970
127992
|
if (buildInfo.program) {
|
|
127971
127993
|
// If there are pending changes that are not emitted, project is out of date
|
|
127994
|
+
// When there are syntax errors, changeFileSet will have list of files changed (irrespective of noEmit)
|
|
127995
|
+
// But in case of semantic error we need special treatment.
|
|
127996
|
+
// Checking presence of affectedFilesPendingEmit list is fast and good way to tell if there were semantic errors and file emit was blocked
|
|
127997
|
+
// But if noEmit is true, affectedFilesPendingEmit will have file list even if there are no semantic errors to preserve list of files to be emitted when running with noEmit false
|
|
127998
|
+
// So with noEmit set to true, check on semantic diagnostics needs to be explicit as oppose to when it is false when only files pending emit is sufficient
|
|
127972
127999
|
if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
127973
|
-
(!project.options.noEmit
|
|
128000
|
+
(!project.options.noEmit ?
|
|
128001
|
+
(_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
|
|
128002
|
+
ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
|
|
127974
128003
|
return {
|
|
127975
128004
|
type: ts.UpToDateStatusType.OutOfDateBuildInfo,
|
|
127976
128005
|
buildInfoFile: buildInfoPath
|
|
@@ -99,7 +99,7 @@ var ts;
|
|
|
99
99
|
// The following is baselined as a literal template type without intervention
|
|
100
100
|
/** The version of the TypeScript compiler release */
|
|
101
101
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
102
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
102
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220928");
|
|
103
103
|
/* @internal */
|
|
104
104
|
var Comparison;
|
|
105
105
|
(function (Comparison) {
|
|
@@ -63333,7 +63333,18 @@ var ts;
|
|
|
63333
63333
|
return accessFlags & 1 /* AccessFlags.IncludeUndefined */ ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
|
|
63334
63334
|
}
|
|
63335
63335
|
errorIfWritingToReadonlyIndex(indexInfo);
|
|
63336
|
-
|
|
63336
|
+
// When accessing an enum object with its own type,
|
|
63337
|
+
// e.g. E[E.A] for enum E { A }, undefined shouldn't
|
|
63338
|
+
// be included in the result type
|
|
63339
|
+
if ((accessFlags & 1 /* AccessFlags.IncludeUndefined */) &&
|
|
63340
|
+
!(objectType.symbol &&
|
|
63341
|
+
objectType.symbol.flags & (256 /* SymbolFlags.RegularEnum */ | 128 /* SymbolFlags.ConstEnum */) &&
|
|
63342
|
+
(indexType.symbol &&
|
|
63343
|
+
indexType.flags & 1024 /* TypeFlags.EnumLiteral */ &&
|
|
63344
|
+
getParentOfSymbol(indexType.symbol) === objectType.symbol))) {
|
|
63345
|
+
return getUnionType([indexInfo.type, undefinedType]);
|
|
63346
|
+
}
|
|
63347
|
+
return indexInfo.type;
|
|
63337
63348
|
}
|
|
63338
63349
|
if (indexType.flags & 131072 /* TypeFlags.Never */) {
|
|
63339
63350
|
return neverType;
|
|
@@ -70752,7 +70763,7 @@ var ts;
|
|
|
70752
70763
|
}
|
|
70753
70764
|
if (ts.isEntityNameExpression(node.argumentExpression)) {
|
|
70754
70765
|
var symbol = resolveEntityName(node.argumentExpression, 111551 /* SymbolFlags.Value */, /*ignoreErrors*/ true);
|
|
70755
|
-
if (!symbol || !isConstVariable(symbol))
|
|
70766
|
+
if (!symbol || !(isConstVariable(symbol) || (symbol.flags & 8 /* SymbolFlags.EnumMember */)))
|
|
70756
70767
|
return undefined;
|
|
70757
70768
|
var declaration = symbol.valueDeclaration;
|
|
70758
70769
|
if (declaration === undefined)
|
|
@@ -70766,7 +70777,12 @@ var ts;
|
|
|
70766
70777
|
}
|
|
70767
70778
|
if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
|
|
70768
70779
|
var initializer = ts.getEffectiveInitializer(declaration);
|
|
70769
|
-
|
|
70780
|
+
if (initializer) {
|
|
70781
|
+
return tryGetNameFromType(getTypeOfExpression(initializer));
|
|
70782
|
+
}
|
|
70783
|
+
if (ts.isEnumMember(declaration)) {
|
|
70784
|
+
return ts.getTextOfPropertyName(declaration.name);
|
|
70785
|
+
}
|
|
70770
70786
|
}
|
|
70771
70787
|
}
|
|
70772
70788
|
return undefined;
|
|
@@ -122531,10 +122547,16 @@ var ts;
|
|
|
122531
122547
|
var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
|
|
122532
122548
|
var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
|
|
122533
122549
|
!ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
|
|
122550
|
+
// We can only reuse emit signatures (i.e. .d.ts signatures) if the .d.ts file is unchanged,
|
|
122551
|
+
// which will eg be depedent on change in options like declarationDir and outDir options are unchanged.
|
|
122552
|
+
// We need to look in oldState.compilerOptions, rather than oldCompilerOptions (i.e.we need to disregard useOldState) because
|
|
122553
|
+
// oldCompilerOptions can be undefined if there was change in say module from None to some other option
|
|
122554
|
+
// which would make useOldState as false since we can now use reference maps that are needed to track what to emit, what to check etc
|
|
122555
|
+
// but that option change does not affect d.ts file name so emitSignatures should still be reused.
|
|
122534
122556
|
var canCopyEmitSignatures = compilerOptions.composite &&
|
|
122535
122557
|
(oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
|
|
122536
122558
|
!outFilePath &&
|
|
122537
|
-
!ts.compilerOptionsAffectDeclarationPath(compilerOptions,
|
|
122559
|
+
!ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
|
|
122538
122560
|
if (useOldState) {
|
|
122539
122561
|
// Copy old state's changed files set
|
|
122540
122562
|
(_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
|
|
@@ -127969,8 +127991,15 @@ var ts;
|
|
|
127969
127991
|
}
|
|
127970
127992
|
if (buildInfo.program) {
|
|
127971
127993
|
// If there are pending changes that are not emitted, project is out of date
|
|
127994
|
+
// When there are syntax errors, changeFileSet will have list of files changed (irrespective of noEmit)
|
|
127995
|
+
// But in case of semantic error we need special treatment.
|
|
127996
|
+
// Checking presence of affectedFilesPendingEmit list is fast and good way to tell if there were semantic errors and file emit was blocked
|
|
127997
|
+
// But if noEmit is true, affectedFilesPendingEmit will have file list even if there are no semantic errors to preserve list of files to be emitted when running with noEmit false
|
|
127998
|
+
// So with noEmit set to true, check on semantic diagnostics needs to be explicit as oppose to when it is false when only files pending emit is sufficient
|
|
127972
127999
|
if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
127973
|
-
(!project.options.noEmit
|
|
128000
|
+
(!project.options.noEmit ?
|
|
128001
|
+
(_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
|
|
128002
|
+
ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
|
|
127974
128003
|
return {
|
|
127975
128004
|
type: ts.UpToDateStatusType.OutOfDateBuildInfo,
|
|
127976
128005
|
buildInfoFile: buildInfoPath
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
92
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220928");
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -63323,7 +63323,18 @@ var ts;
|
|
|
63323
63323
|
return accessFlags & 1 /* AccessFlags.IncludeUndefined */ ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
|
|
63324
63324
|
}
|
|
63325
63325
|
errorIfWritingToReadonlyIndex(indexInfo);
|
|
63326
|
-
|
|
63326
|
+
// When accessing an enum object with its own type,
|
|
63327
|
+
// e.g. E[E.A] for enum E { A }, undefined shouldn't
|
|
63328
|
+
// be included in the result type
|
|
63329
|
+
if ((accessFlags & 1 /* AccessFlags.IncludeUndefined */) &&
|
|
63330
|
+
!(objectType.symbol &&
|
|
63331
|
+
objectType.symbol.flags & (256 /* SymbolFlags.RegularEnum */ | 128 /* SymbolFlags.ConstEnum */) &&
|
|
63332
|
+
(indexType.symbol &&
|
|
63333
|
+
indexType.flags & 1024 /* TypeFlags.EnumLiteral */ &&
|
|
63334
|
+
getParentOfSymbol(indexType.symbol) === objectType.symbol))) {
|
|
63335
|
+
return getUnionType([indexInfo.type, undefinedType]);
|
|
63336
|
+
}
|
|
63337
|
+
return indexInfo.type;
|
|
63327
63338
|
}
|
|
63328
63339
|
if (indexType.flags & 131072 /* TypeFlags.Never */) {
|
|
63329
63340
|
return neverType;
|
|
@@ -70742,7 +70753,7 @@ var ts;
|
|
|
70742
70753
|
}
|
|
70743
70754
|
if (ts.isEntityNameExpression(node.argumentExpression)) {
|
|
70744
70755
|
var symbol = resolveEntityName(node.argumentExpression, 111551 /* SymbolFlags.Value */, /*ignoreErrors*/ true);
|
|
70745
|
-
if (!symbol || !isConstVariable(symbol))
|
|
70756
|
+
if (!symbol || !(isConstVariable(symbol) || (symbol.flags & 8 /* SymbolFlags.EnumMember */)))
|
|
70746
70757
|
return undefined;
|
|
70747
70758
|
var declaration = symbol.valueDeclaration;
|
|
70748
70759
|
if (declaration === undefined)
|
|
@@ -70756,7 +70767,12 @@ var ts;
|
|
|
70756
70767
|
}
|
|
70757
70768
|
if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
|
|
70758
70769
|
var initializer = ts.getEffectiveInitializer(declaration);
|
|
70759
|
-
|
|
70770
|
+
if (initializer) {
|
|
70771
|
+
return tryGetNameFromType(getTypeOfExpression(initializer));
|
|
70772
|
+
}
|
|
70773
|
+
if (ts.isEnumMember(declaration)) {
|
|
70774
|
+
return ts.getTextOfPropertyName(declaration.name);
|
|
70775
|
+
}
|
|
70760
70776
|
}
|
|
70761
70777
|
}
|
|
70762
70778
|
return undefined;
|
|
@@ -122521,10 +122537,16 @@ var ts;
|
|
|
122521
122537
|
var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
|
|
122522
122538
|
var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
|
|
122523
122539
|
!ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
|
|
122540
|
+
// We can only reuse emit signatures (i.e. .d.ts signatures) if the .d.ts file is unchanged,
|
|
122541
|
+
// which will eg be depedent on change in options like declarationDir and outDir options are unchanged.
|
|
122542
|
+
// We need to look in oldState.compilerOptions, rather than oldCompilerOptions (i.e.we need to disregard useOldState) because
|
|
122543
|
+
// oldCompilerOptions can be undefined if there was change in say module from None to some other option
|
|
122544
|
+
// which would make useOldState as false since we can now use reference maps that are needed to track what to emit, what to check etc
|
|
122545
|
+
// but that option change does not affect d.ts file name so emitSignatures should still be reused.
|
|
122524
122546
|
var canCopyEmitSignatures = compilerOptions.composite &&
|
|
122525
122547
|
(oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
|
|
122526
122548
|
!outFilePath &&
|
|
122527
|
-
!ts.compilerOptionsAffectDeclarationPath(compilerOptions,
|
|
122549
|
+
!ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
|
|
122528
122550
|
if (useOldState) {
|
|
122529
122551
|
// Copy old state's changed files set
|
|
122530
122552
|
(_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
|
|
@@ -127959,8 +127981,15 @@ var ts;
|
|
|
127959
127981
|
}
|
|
127960
127982
|
if (buildInfo.program) {
|
|
127961
127983
|
// If there are pending changes that are not emitted, project is out of date
|
|
127984
|
+
// When there are syntax errors, changeFileSet will have list of files changed (irrespective of noEmit)
|
|
127985
|
+
// But in case of semantic error we need special treatment.
|
|
127986
|
+
// Checking presence of affectedFilesPendingEmit list is fast and good way to tell if there were semantic errors and file emit was blocked
|
|
127987
|
+
// But if noEmit is true, affectedFilesPendingEmit will have file list even if there are no semantic errors to preserve list of files to be emitted when running with noEmit false
|
|
127988
|
+
// So with noEmit set to true, check on semantic diagnostics needs to be explicit as oppose to when it is false when only files pending emit is sufficient
|
|
127962
127989
|
if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
127963
|
-
(!project.options.noEmit
|
|
127990
|
+
(!project.options.noEmit ?
|
|
127991
|
+
(_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
|
|
127992
|
+
ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
|
|
127964
127993
|
return {
|
|
127965
127994
|
type: ts.UpToDateStatusType.OutOfDateBuildInfo,
|
|
127966
127995
|
buildInfoFile: buildInfoPath
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "4.9.0-dev.
|
|
5
|
+
"version": "4.9.0-dev.20220928",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|