@typescript-deploys/pr-build 5.1.0-pr-53268-4 → 5.1.0-pr-53292-2
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 +41 -55
- package/lib/tsserver.js +69 -79
- package/lib/tsserverlibrary.js +66 -78
- package/lib/typescript.js +42 -57
- package/lib/typingsInstaller.js +26 -44
- package/package.json +2 -2
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230316`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3081,40 +3081,17 @@ ${lanes.join("\n")}
|
|
|
3081
3081
|
});
|
|
3082
3082
|
|
|
3083
3083
|
// src/compiler/perfLogger.ts
|
|
3084
|
-
var
|
|
3084
|
+
var etwModule, _a, perfLogger;
|
|
3085
3085
|
var init_perfLogger = __esm({
|
|
3086
3086
|
"src/compiler/perfLogger.ts"() {
|
|
3087
3087
|
"use strict";
|
|
3088
|
-
init_ts2();
|
|
3089
|
-
nullLogger = {
|
|
3090
|
-
logEvent: noop,
|
|
3091
|
-
logErrEvent: noop,
|
|
3092
|
-
logPerfEvent: noop,
|
|
3093
|
-
logInfoEvent: noop,
|
|
3094
|
-
logStartCommand: noop,
|
|
3095
|
-
logStopCommand: noop,
|
|
3096
|
-
logStartUpdateProgram: noop,
|
|
3097
|
-
logStopUpdateProgram: noop,
|
|
3098
|
-
logStartUpdateGraph: noop,
|
|
3099
|
-
logStopUpdateGraph: noop,
|
|
3100
|
-
logStartResolveModule: noop,
|
|
3101
|
-
logStopResolveModule: noop,
|
|
3102
|
-
logStartParseSourceFile: noop,
|
|
3103
|
-
logStopParseSourceFile: noop,
|
|
3104
|
-
logStartReadFile: noop,
|
|
3105
|
-
logStopReadFile: noop,
|
|
3106
|
-
logStartBindFile: noop,
|
|
3107
|
-
logStopBindFile: noop,
|
|
3108
|
-
logStartScheduledOperation: noop,
|
|
3109
|
-
logStopScheduledOperation: noop
|
|
3110
|
-
};
|
|
3111
3088
|
try {
|
|
3112
3089
|
const etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) != null ? _a : "./node_modules/@microsoft/typescript-etw";
|
|
3113
3090
|
etwModule = require(etwModulePath);
|
|
3114
3091
|
} catch (e) {
|
|
3115
3092
|
etwModule = void 0;
|
|
3116
3093
|
}
|
|
3117
|
-
perfLogger = (etwModule == null ? void 0 : etwModule.logEvent) ? etwModule :
|
|
3094
|
+
perfLogger = (etwModule == null ? void 0 : etwModule.logEvent) ? etwModule : void 0;
|
|
3118
3095
|
}
|
|
3119
3096
|
});
|
|
3120
3097
|
|
|
@@ -6428,13 +6405,15 @@ ${lanes.join("\n")}
|
|
|
6428
6405
|
return buffer.toString("utf8");
|
|
6429
6406
|
}
|
|
6430
6407
|
function readFile(fileName, _encoding) {
|
|
6431
|
-
|
|
6408
|
+
var _a2, _b;
|
|
6409
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartReadFile(fileName);
|
|
6432
6410
|
const file = readFileWorker(fileName, _encoding);
|
|
6433
|
-
perfLogger.logStopReadFile();
|
|
6411
|
+
(_b = perfLogger) == null ? void 0 : _b.logStopReadFile();
|
|
6434
6412
|
return file;
|
|
6435
6413
|
}
|
|
6436
6414
|
function writeFile2(fileName, data, writeByteOrderMark) {
|
|
6437
|
-
|
|
6415
|
+
var _a2;
|
|
6416
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logEvent("WriteFile: " + fileName);
|
|
6438
6417
|
if (writeByteOrderMark) {
|
|
6439
6418
|
data = byteOrderMarkIndicator + data;
|
|
6440
6419
|
}
|
|
@@ -6455,7 +6434,8 @@ ${lanes.join("\n")}
|
|
|
6455
6434
|
}
|
|
6456
6435
|
}
|
|
6457
6436
|
function getAccessibleFileSystemEntries(path) {
|
|
6458
|
-
|
|
6437
|
+
var _a2;
|
|
6438
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logEvent("ReadDir: " + (path || "."));
|
|
6459
6439
|
try {
|
|
6460
6440
|
const entries = _fs.readdirSync(path || ".", { withFileTypes: true });
|
|
6461
6441
|
const files = [];
|
|
@@ -27727,7 +27707,7 @@ ${lanes.join("\n")}
|
|
|
27727
27707
|
sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
|
|
27728
27708
|
}
|
|
27729
27709
|
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) {
|
|
27730
|
-
var _a2, _b;
|
|
27710
|
+
var _a2, _b, _c, _d;
|
|
27731
27711
|
(_a2 = tracing) == null ? void 0 : _a2.push(
|
|
27732
27712
|
tracing.Phase.Parse,
|
|
27733
27713
|
"createSourceFile",
|
|
@@ -27737,7 +27717,7 @@ ${lanes.join("\n")}
|
|
|
27737
27717
|
);
|
|
27738
27718
|
mark("beforeParse");
|
|
27739
27719
|
let result;
|
|
27740
|
-
perfLogger.logStartParseSourceFile(fileName);
|
|
27720
|
+
(_b = perfLogger) == null ? void 0 : _b.logStartParseSourceFile(fileName);
|
|
27741
27721
|
const {
|
|
27742
27722
|
languageVersion,
|
|
27743
27723
|
setExternalModuleIndicator: overrideSetExternalModuleIndicator,
|
|
@@ -27770,10 +27750,10 @@ ${lanes.join("\n")}
|
|
|
27770
27750
|
setIndicator
|
|
27771
27751
|
);
|
|
27772
27752
|
}
|
|
27773
|
-
perfLogger.logStopParseSourceFile();
|
|
27753
|
+
(_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
|
|
27774
27754
|
mark("afterParse");
|
|
27775
27755
|
measure("Parse", "beforeParse", "afterParse");
|
|
27776
|
-
(
|
|
27756
|
+
(_d = tracing) == null ? void 0 : _d.pop();
|
|
27777
27757
|
return result;
|
|
27778
27758
|
}
|
|
27779
27759
|
function parseIsolatedEntityName(text, languageVersion) {
|
|
@@ -39498,6 +39478,7 @@ ${lanes.join("\n")}
|
|
|
39498
39478
|
);
|
|
39499
39479
|
}
|
|
39500
39480
|
function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
39481
|
+
var _a2, _b, _c;
|
|
39501
39482
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
39502
39483
|
if (redirectedReference) {
|
|
39503
39484
|
compilerOptions = redirectedReference.commandLine.options;
|
|
@@ -39539,10 +39520,7 @@ ${lanes.join("\n")}
|
|
|
39539
39520
|
trace(host, Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ModuleResolutionKind[moduleResolution]);
|
|
39540
39521
|
}
|
|
39541
39522
|
}
|
|
39542
|
-
perfLogger.logStartResolveModule(
|
|
39543
|
-
moduleName
|
|
39544
|
-
/* , containingFile, ModuleResolutionKind[moduleResolution]*/
|
|
39545
|
-
);
|
|
39523
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartResolveModule(moduleName);
|
|
39546
39524
|
switch (moduleResolution) {
|
|
39547
39525
|
case 3 /* Node16 */:
|
|
39548
39526
|
result = node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
@@ -39563,8 +39541,8 @@ ${lanes.join("\n")}
|
|
|
39563
39541
|
return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`);
|
|
39564
39542
|
}
|
|
39565
39543
|
if (result && result.resolvedModule)
|
|
39566
|
-
perfLogger.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`);
|
|
39567
|
-
perfLogger.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
39544
|
+
(_b = perfLogger) == null ? void 0 : _b.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`);
|
|
39545
|
+
(_c = perfLogger) == null ? void 0 : _c.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
39568
39546
|
cache == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(moduleName, resolutionMode, result);
|
|
39569
39547
|
if (!isExternalModuleNameRelative(moduleName)) {
|
|
39570
39548
|
cache == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
@@ -41336,10 +41314,11 @@ ${lanes.join("\n")}
|
|
|
41336
41314
|
return node;
|
|
41337
41315
|
}
|
|
41338
41316
|
function bindSourceFile(file, options) {
|
|
41317
|
+
var _a2, _b;
|
|
41339
41318
|
mark("beforeBind");
|
|
41340
|
-
perfLogger.logStartBindFile("" + file.fileName);
|
|
41319
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartBindFile("" + file.fileName);
|
|
41341
41320
|
binder(file, options);
|
|
41342
|
-
perfLogger.logStopBindFile();
|
|
41321
|
+
(_b = perfLogger) == null ? void 0 : _b.logStopBindFile();
|
|
41343
41322
|
mark("afterBind");
|
|
41344
41323
|
measure("Bind", "beforeBind", "afterBind");
|
|
41345
41324
|
}
|
|
@@ -48414,7 +48393,7 @@ ${lanes.join("\n")}
|
|
|
48414
48393
|
/*skipObjectFunctionPropertyAugment*/
|
|
48415
48394
|
true
|
|
48416
48395
|
) || isEsmCjsRef) {
|
|
48417
|
-
const moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference);
|
|
48396
|
+
const moduleType = type.flags & 3670016 /* StructuredType */ ? getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference) : createDefaultPropertyWrapperForModule(symbol, symbol.parent);
|
|
48418
48397
|
return cloneTypeAsModuleType(symbol, moduleType, referenceParent);
|
|
48419
48398
|
}
|
|
48420
48399
|
}
|
|
@@ -61063,8 +61042,20 @@ ${lanes.join("\n")}
|
|
|
61063
61042
|
return result;
|
|
61064
61043
|
}
|
|
61065
61044
|
const moreThanOneRealChildren = length(validChildren) > 1;
|
|
61066
|
-
|
|
61067
|
-
|
|
61045
|
+
let arrayLikeTargetParts;
|
|
61046
|
+
let nonArrayLikeTargetParts;
|
|
61047
|
+
const iterableType = getGlobalIterableType(
|
|
61048
|
+
/*reportErrors*/
|
|
61049
|
+
false
|
|
61050
|
+
);
|
|
61051
|
+
if (iterableType !== emptyGenericType) {
|
|
61052
|
+
const anyIterable = createIterableType(anyType);
|
|
61053
|
+
arrayLikeTargetParts = filterType(childrenTargetType, (t) => isTypeAssignableTo(t, anyIterable));
|
|
61054
|
+
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isTypeAssignableTo(t, anyIterable));
|
|
61055
|
+
} else {
|
|
61056
|
+
arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType);
|
|
61057
|
+
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isArrayOrTupleLikeType(t));
|
|
61058
|
+
}
|
|
61068
61059
|
if (moreThanOneRealChildren) {
|
|
61069
61060
|
if (arrayLikeTargetParts !== neverType) {
|
|
61070
61061
|
const realSource = createTupleType(checkJsxChildren(containingElement, 0 /* Normal */));
|
|
@@ -64344,13 +64335,6 @@ ${lanes.join("\n")}
|
|
|
64344
64335
|
function isArrayOrTupleLikeType(type) {
|
|
64345
64336
|
return isArrayLikeType(type) || isTupleLikeType(type);
|
|
64346
64337
|
}
|
|
64347
|
-
function isAssignableToAvailableAnyIterable(type) {
|
|
64348
|
-
const anyIterable = getGlobalIterableType(
|
|
64349
|
-
/*reportErrors*/
|
|
64350
|
-
false
|
|
64351
|
-
) !== emptyGenericType && createIterableType(anyType);
|
|
64352
|
-
return anyIterable ? isTypeAssignableTo(type, anyIterable) : isArrayOrTupleLikeType(type);
|
|
64353
|
-
}
|
|
64354
64338
|
function getTupleElementType(type, index) {
|
|
64355
64339
|
const propType = getTypeOfPropertyOfType(type, "" + index);
|
|
64356
64340
|
if (propType) {
|
|
@@ -69104,7 +69088,7 @@ ${lanes.join("\n")}
|
|
|
69104
69088
|
return void 0;
|
|
69105
69089
|
}
|
|
69106
69090
|
function getContextualTypeForElementExpression(arrayContextualType, index) {
|
|
69107
|
-
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(
|
|
69091
|
+
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType(
|
|
69108
69092
|
arrayContextualType,
|
|
69109
69093
|
(t) => isTupleType(t) ? getElementTypeOfSliceOfTupleType(
|
|
69110
69094
|
t,
|
|
@@ -122832,21 +122816,22 @@ ${lanes.join("\n")}
|
|
|
122832
122816
|
updateProgram();
|
|
122833
122817
|
}
|
|
122834
122818
|
function updateProgram() {
|
|
122819
|
+
var _a2, _b, _c, _d;
|
|
122835
122820
|
switch (reloadLevel) {
|
|
122836
122821
|
case 1 /* Partial */:
|
|
122837
|
-
perfLogger.logStartUpdateProgram("PartialConfigReload");
|
|
122822
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartUpdateProgram("PartialConfigReload");
|
|
122838
122823
|
reloadFileNamesFromConfigFile();
|
|
122839
122824
|
break;
|
|
122840
122825
|
case 2 /* Full */:
|
|
122841
|
-
perfLogger.logStartUpdateProgram("FullConfigReload");
|
|
122826
|
+
(_b = perfLogger) == null ? void 0 : _b.logStartUpdateProgram("FullConfigReload");
|
|
122842
122827
|
reloadConfigFile();
|
|
122843
122828
|
break;
|
|
122844
122829
|
default:
|
|
122845
|
-
perfLogger.logStartUpdateProgram("SynchronizeProgram");
|
|
122830
|
+
(_c = perfLogger) == null ? void 0 : _c.logStartUpdateProgram("SynchronizeProgram");
|
|
122846
122831
|
synchronizeProgram();
|
|
122847
122832
|
break;
|
|
122848
122833
|
}
|
|
122849
|
-
perfLogger.logStopUpdateProgram("Done");
|
|
122834
|
+
(_d = perfLogger) == null ? void 0 : _d.logStopUpdateProgram("Done");
|
|
122850
122835
|
return getCurrentBuilderProgram();
|
|
122851
122836
|
}
|
|
122852
122837
|
function reloadFileNamesFromConfigFile() {
|
|
@@ -167965,13 +167950,14 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
167965
167950
|
return this.pendingTimeouts.delete(operationId);
|
|
167966
167951
|
}
|
|
167967
167952
|
static run(self, operationId, cb) {
|
|
167968
|
-
|
|
167953
|
+
var _a2, _b;
|
|
167954
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartScheduledOperation(operationId);
|
|
167969
167955
|
self.pendingTimeouts.delete(operationId);
|
|
167970
167956
|
if (self.logger) {
|
|
167971
167957
|
self.logger.info(`Running: ${operationId}`);
|
|
167972
167958
|
}
|
|
167973
167959
|
cb();
|
|
167974
|
-
perfLogger.logStopScheduledOperation();
|
|
167960
|
+
(_b = perfLogger) == null ? void 0 : _b.logStopScheduledOperation();
|
|
167975
167961
|
}
|
|
167976
167962
|
};
|
|
167977
167963
|
GcTimer = class {
|
|
@@ -167987,8 +167973,9 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
167987
167973
|
this.timerId = this.host.setTimeout(GcTimer.run, this.delay, this);
|
|
167988
167974
|
}
|
|
167989
167975
|
static run(self) {
|
|
167976
|
+
var _a2, _b;
|
|
167990
167977
|
self.timerId = void 0;
|
|
167991
|
-
perfLogger.logStartScheduledOperation("GC collect");
|
|
167978
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartScheduledOperation("GC collect");
|
|
167992
167979
|
const log = self.logger.hasLevel(2 /* requestTime */);
|
|
167993
167980
|
const before = log && self.host.getMemoryUsage();
|
|
167994
167981
|
self.host.gc();
|
|
@@ -167996,7 +167983,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
167996
167983
|
const after = self.host.getMemoryUsage();
|
|
167997
167984
|
self.logger.perftrc(`GC::before ${before}, after ${after}`);
|
|
167998
167985
|
}
|
|
167999
|
-
perfLogger.logStopScheduledOperation();
|
|
167986
|
+
(_b = perfLogger) == null ? void 0 : _b.logStopScheduledOperation();
|
|
168000
167987
|
}
|
|
168001
167988
|
};
|
|
168002
167989
|
indentStr = "\n ";
|
|
@@ -169746,9 +169733,9 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
169746
169733
|
* @returns: true if set of files in the project stays the same and false - otherwise.
|
|
169747
169734
|
*/
|
|
169748
169735
|
updateGraph() {
|
|
169749
|
-
var _a2, _b, _c;
|
|
169736
|
+
var _a2, _b, _c, _d, _e;
|
|
169750
169737
|
(_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Session, "updateGraph", { name: this.projectName, kind: ProjectKind[this.projectKind] });
|
|
169751
|
-
perfLogger.logStartUpdateGraph();
|
|
169738
|
+
(_b = perfLogger) == null ? void 0 : _b.logStartUpdateGraph();
|
|
169752
169739
|
this.resolutionCache.startRecordingFilesWithChangedResolutions();
|
|
169753
169740
|
const hasNewProgram = this.updateGraphWorker();
|
|
169754
169741
|
const hasAddedorRemovedFiles = this.hasAddedorRemovedFiles;
|
|
@@ -169773,13 +169760,13 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
169773
169760
|
if (hasAddedorRemovedFiles) {
|
|
169774
169761
|
if (!this.autoImportProviderHost)
|
|
169775
169762
|
this.autoImportProviderHost = void 0;
|
|
169776
|
-
(
|
|
169763
|
+
(_c = this.autoImportProviderHost) == null ? void 0 : _c.markAsDirty();
|
|
169777
169764
|
}
|
|
169778
169765
|
if (isFirstProgramLoad) {
|
|
169779
169766
|
this.getPackageJsonAutoImportProvider();
|
|
169780
169767
|
}
|
|
169781
|
-
perfLogger.logStopUpdateGraph();
|
|
169782
|
-
(
|
|
169768
|
+
(_d = perfLogger) == null ? void 0 : _d.logStopUpdateGraph();
|
|
169769
|
+
(_e = tracing) == null ? void 0 : _e.pop();
|
|
169783
169770
|
return !hasNewProgram;
|
|
169784
169771
|
}
|
|
169785
169772
|
/** @internal */
|
|
@@ -175957,8 +175944,9 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
175957
175944
|
this.writeMessage(msg);
|
|
175958
175945
|
}
|
|
175959
175946
|
writeMessage(msg) {
|
|
175947
|
+
var _a2;
|
|
175960
175948
|
const msgText = formatMessage2(msg, this.logger, this.byteLength, this.host.newLine);
|
|
175961
|
-
perfLogger.logEvent(`Response message size: ${msgText.length}`);
|
|
175949
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logEvent(`Response message size: ${msgText.length}`);
|
|
175962
175950
|
this.host.write(msgText);
|
|
175963
175951
|
}
|
|
175964
175952
|
event(body, eventName) {
|
|
@@ -177726,7 +177714,7 @@ ${e.message}`;
|
|
|
177726
177714
|
}
|
|
177727
177715
|
}
|
|
177728
177716
|
onMessage(message) {
|
|
177729
|
-
var _a2, _b, _c, _d, _e, _f, _g;
|
|
177717
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
177730
177718
|
this.gcTimer.scheduleCollect();
|
|
177731
177719
|
this.performanceData = void 0;
|
|
177732
177720
|
let start;
|
|
@@ -177742,8 +177730,8 @@ ${e.message}`;
|
|
|
177742
177730
|
request = this.parseMessage(message);
|
|
177743
177731
|
relevantFile = request.arguments && request.arguments.file ? request.arguments : void 0;
|
|
177744
177732
|
(_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.Session, "request", { seq: request.seq, command: request.command });
|
|
177745
|
-
perfLogger.logStartCommand("" + request.command, this.toStringMessage(message).substring(0, 100));
|
|
177746
|
-
(
|
|
177733
|
+
(_b = perfLogger) == null ? void 0 : _b.logStartCommand("" + request.command, this.toStringMessage(message).substring(0, 100));
|
|
177734
|
+
(_c = tracing) == null ? void 0 : _c.push(
|
|
177747
177735
|
tracing.Phase.Session,
|
|
177748
177736
|
"executeCommand",
|
|
177749
177737
|
{ seq: request.seq, command: request.command },
|
|
@@ -177751,7 +177739,7 @@ ${e.message}`;
|
|
|
177751
177739
|
true
|
|
177752
177740
|
);
|
|
177753
177741
|
const { response, responseRequired } = this.executeCommand(request);
|
|
177754
|
-
(
|
|
177742
|
+
(_d = tracing) == null ? void 0 : _d.pop();
|
|
177755
177743
|
if (this.logger.hasLevel(2 /* requestTime */)) {
|
|
177756
177744
|
const elapsedTime = hrTimeToMilliseconds(this.hrtime(start)).toFixed(4);
|
|
177757
177745
|
if (responseRequired) {
|
|
@@ -177760,8 +177748,8 @@ ${e.message}`;
|
|
|
177760
177748
|
this.logger.perftrc(`${request.seq}::${request.command}: async elapsed time (in milliseconds) ${elapsedTime}`);
|
|
177761
177749
|
}
|
|
177762
177750
|
}
|
|
177763
|
-
perfLogger.logStopCommand("" + request.command, "Success");
|
|
177764
|
-
(
|
|
177751
|
+
(_e = perfLogger) == null ? void 0 : _e.logStopCommand("" + request.command, "Success");
|
|
177752
|
+
(_f = tracing) == null ? void 0 : _f.instant(tracing.Phase.Session, "response", { seq: request.seq, command: request.command, success: !!response });
|
|
177765
177753
|
if (response) {
|
|
177766
177754
|
this.doOutput(
|
|
177767
177755
|
response,
|
|
@@ -177782,10 +177770,10 @@ ${e.message}`;
|
|
|
177782
177770
|
);
|
|
177783
177771
|
}
|
|
177784
177772
|
} catch (err) {
|
|
177785
|
-
(
|
|
177773
|
+
(_g = tracing) == null ? void 0 : _g.popAll();
|
|
177786
177774
|
if (err instanceof OperationCanceledException) {
|
|
177787
|
-
perfLogger.logStopCommand("" + (request && request.command), "Canceled: " + err);
|
|
177788
|
-
(
|
|
177775
|
+
(_h = perfLogger) == null ? void 0 : _h.logStopCommand("" + (request && request.command), "Canceled: " + err);
|
|
177776
|
+
(_i = tracing) == null ? void 0 : _i.instant(tracing.Phase.Session, "commandCanceled", { seq: request == null ? void 0 : request.seq, command: request == null ? void 0 : request.command });
|
|
177789
177777
|
this.doOutput(
|
|
177790
177778
|
{ canceled: true },
|
|
177791
177779
|
request.command,
|
|
@@ -177796,8 +177784,8 @@ ${e.message}`;
|
|
|
177796
177784
|
return;
|
|
177797
177785
|
}
|
|
177798
177786
|
this.logErrorWorker(err, this.toStringMessage(message), relevantFile);
|
|
177799
|
-
perfLogger.logStopCommand("" + (request && request.command), "Error: " + err);
|
|
177800
|
-
(
|
|
177787
|
+
(_j = perfLogger) == null ? void 0 : _j.logStopCommand("" + (request && request.command), "Error: " + err);
|
|
177788
|
+
(_k = tracing) == null ? void 0 : _k.instant(tracing.Phase.Session, "commandError", { seq: request == null ? void 0 : request.seq, command: request == null ? void 0 : request.command, message: err.message });
|
|
177801
177789
|
this.doOutput(
|
|
177802
177790
|
/*info*/
|
|
177803
177791
|
void 0,
|
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230316`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3081,40 +3081,17 @@ ${lanes.join("\n")}
|
|
|
3081
3081
|
});
|
|
3082
3082
|
|
|
3083
3083
|
// src/compiler/perfLogger.ts
|
|
3084
|
-
var
|
|
3084
|
+
var etwModule, _a, perfLogger;
|
|
3085
3085
|
var init_perfLogger = __esm({
|
|
3086
3086
|
"src/compiler/perfLogger.ts"() {
|
|
3087
3087
|
"use strict";
|
|
3088
|
-
init_ts2();
|
|
3089
|
-
nullLogger = {
|
|
3090
|
-
logEvent: noop,
|
|
3091
|
-
logErrEvent: noop,
|
|
3092
|
-
logPerfEvent: noop,
|
|
3093
|
-
logInfoEvent: noop,
|
|
3094
|
-
logStartCommand: noop,
|
|
3095
|
-
logStopCommand: noop,
|
|
3096
|
-
logStartUpdateProgram: noop,
|
|
3097
|
-
logStopUpdateProgram: noop,
|
|
3098
|
-
logStartUpdateGraph: noop,
|
|
3099
|
-
logStopUpdateGraph: noop,
|
|
3100
|
-
logStartResolveModule: noop,
|
|
3101
|
-
logStopResolveModule: noop,
|
|
3102
|
-
logStartParseSourceFile: noop,
|
|
3103
|
-
logStopParseSourceFile: noop,
|
|
3104
|
-
logStartReadFile: noop,
|
|
3105
|
-
logStopReadFile: noop,
|
|
3106
|
-
logStartBindFile: noop,
|
|
3107
|
-
logStopBindFile: noop,
|
|
3108
|
-
logStartScheduledOperation: noop,
|
|
3109
|
-
logStopScheduledOperation: noop
|
|
3110
|
-
};
|
|
3111
3088
|
try {
|
|
3112
3089
|
const etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) != null ? _a : "./node_modules/@microsoft/typescript-etw";
|
|
3113
3090
|
etwModule = require(etwModulePath);
|
|
3114
3091
|
} catch (e) {
|
|
3115
3092
|
etwModule = void 0;
|
|
3116
3093
|
}
|
|
3117
|
-
perfLogger = (etwModule == null ? void 0 : etwModule.logEvent) ? etwModule :
|
|
3094
|
+
perfLogger = (etwModule == null ? void 0 : etwModule.logEvent) ? etwModule : void 0;
|
|
3118
3095
|
}
|
|
3119
3096
|
});
|
|
3120
3097
|
|
|
@@ -6428,13 +6405,15 @@ ${lanes.join("\n")}
|
|
|
6428
6405
|
return buffer.toString("utf8");
|
|
6429
6406
|
}
|
|
6430
6407
|
function readFile(fileName, _encoding) {
|
|
6431
|
-
|
|
6408
|
+
var _a2, _b;
|
|
6409
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartReadFile(fileName);
|
|
6432
6410
|
const file = readFileWorker(fileName, _encoding);
|
|
6433
|
-
perfLogger.logStopReadFile();
|
|
6411
|
+
(_b = perfLogger) == null ? void 0 : _b.logStopReadFile();
|
|
6434
6412
|
return file;
|
|
6435
6413
|
}
|
|
6436
6414
|
function writeFile2(fileName, data, writeByteOrderMark) {
|
|
6437
|
-
|
|
6415
|
+
var _a2;
|
|
6416
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logEvent("WriteFile: " + fileName);
|
|
6438
6417
|
if (writeByteOrderMark) {
|
|
6439
6418
|
data = byteOrderMarkIndicator + data;
|
|
6440
6419
|
}
|
|
@@ -6455,7 +6434,8 @@ ${lanes.join("\n")}
|
|
|
6455
6434
|
}
|
|
6456
6435
|
}
|
|
6457
6436
|
function getAccessibleFileSystemEntries(path) {
|
|
6458
|
-
|
|
6437
|
+
var _a2;
|
|
6438
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logEvent("ReadDir: " + (path || "."));
|
|
6459
6439
|
try {
|
|
6460
6440
|
const entries = _fs.readdirSync(path || ".", { withFileTypes: true });
|
|
6461
6441
|
const files = [];
|
|
@@ -27727,7 +27707,7 @@ ${lanes.join("\n")}
|
|
|
27727
27707
|
sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
|
|
27728
27708
|
}
|
|
27729
27709
|
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) {
|
|
27730
|
-
var _a2, _b;
|
|
27710
|
+
var _a2, _b, _c, _d;
|
|
27731
27711
|
(_a2 = tracing) == null ? void 0 : _a2.push(
|
|
27732
27712
|
tracing.Phase.Parse,
|
|
27733
27713
|
"createSourceFile",
|
|
@@ -27737,7 +27717,7 @@ ${lanes.join("\n")}
|
|
|
27737
27717
|
);
|
|
27738
27718
|
mark("beforeParse");
|
|
27739
27719
|
let result;
|
|
27740
|
-
perfLogger.logStartParseSourceFile(fileName);
|
|
27720
|
+
(_b = perfLogger) == null ? void 0 : _b.logStartParseSourceFile(fileName);
|
|
27741
27721
|
const {
|
|
27742
27722
|
languageVersion,
|
|
27743
27723
|
setExternalModuleIndicator: overrideSetExternalModuleIndicator,
|
|
@@ -27770,10 +27750,10 @@ ${lanes.join("\n")}
|
|
|
27770
27750
|
setIndicator
|
|
27771
27751
|
);
|
|
27772
27752
|
}
|
|
27773
|
-
perfLogger.logStopParseSourceFile();
|
|
27753
|
+
(_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
|
|
27774
27754
|
mark("afterParse");
|
|
27775
27755
|
measure("Parse", "beforeParse", "afterParse");
|
|
27776
|
-
(
|
|
27756
|
+
(_d = tracing) == null ? void 0 : _d.pop();
|
|
27777
27757
|
return result;
|
|
27778
27758
|
}
|
|
27779
27759
|
function parseIsolatedEntityName(text, languageVersion) {
|
|
@@ -39498,6 +39478,7 @@ ${lanes.join("\n")}
|
|
|
39498
39478
|
);
|
|
39499
39479
|
}
|
|
39500
39480
|
function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
39481
|
+
var _a2, _b, _c;
|
|
39501
39482
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
39502
39483
|
if (redirectedReference) {
|
|
39503
39484
|
compilerOptions = redirectedReference.commandLine.options;
|
|
@@ -39539,10 +39520,7 @@ ${lanes.join("\n")}
|
|
|
39539
39520
|
trace(host, Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ModuleResolutionKind[moduleResolution]);
|
|
39540
39521
|
}
|
|
39541
39522
|
}
|
|
39542
|
-
perfLogger.logStartResolveModule(
|
|
39543
|
-
moduleName
|
|
39544
|
-
/* , containingFile, ModuleResolutionKind[moduleResolution]*/
|
|
39545
|
-
);
|
|
39523
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartResolveModule(moduleName);
|
|
39546
39524
|
switch (moduleResolution) {
|
|
39547
39525
|
case 3 /* Node16 */:
|
|
39548
39526
|
result = node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
@@ -39563,8 +39541,8 @@ ${lanes.join("\n")}
|
|
|
39563
39541
|
return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`);
|
|
39564
39542
|
}
|
|
39565
39543
|
if (result && result.resolvedModule)
|
|
39566
|
-
perfLogger.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`);
|
|
39567
|
-
perfLogger.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
39544
|
+
(_b = perfLogger) == null ? void 0 : _b.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`);
|
|
39545
|
+
(_c = perfLogger) == null ? void 0 : _c.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
39568
39546
|
cache == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(moduleName, resolutionMode, result);
|
|
39569
39547
|
if (!isExternalModuleNameRelative(moduleName)) {
|
|
39570
39548
|
cache == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
@@ -41336,10 +41314,11 @@ ${lanes.join("\n")}
|
|
|
41336
41314
|
return node;
|
|
41337
41315
|
}
|
|
41338
41316
|
function bindSourceFile(file, options) {
|
|
41317
|
+
var _a2, _b;
|
|
41339
41318
|
mark("beforeBind");
|
|
41340
|
-
perfLogger.logStartBindFile("" + file.fileName);
|
|
41319
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartBindFile("" + file.fileName);
|
|
41341
41320
|
binder(file, options);
|
|
41342
|
-
perfLogger.logStopBindFile();
|
|
41321
|
+
(_b = perfLogger) == null ? void 0 : _b.logStopBindFile();
|
|
41343
41322
|
mark("afterBind");
|
|
41344
41323
|
measure("Bind", "beforeBind", "afterBind");
|
|
41345
41324
|
}
|
|
@@ -48414,7 +48393,7 @@ ${lanes.join("\n")}
|
|
|
48414
48393
|
/*skipObjectFunctionPropertyAugment*/
|
|
48415
48394
|
true
|
|
48416
48395
|
) || isEsmCjsRef) {
|
|
48417
|
-
const moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference);
|
|
48396
|
+
const moduleType = type.flags & 3670016 /* StructuredType */ ? getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference) : createDefaultPropertyWrapperForModule(symbol, symbol.parent);
|
|
48418
48397
|
return cloneTypeAsModuleType(symbol, moduleType, referenceParent);
|
|
48419
48398
|
}
|
|
48420
48399
|
}
|
|
@@ -61063,8 +61042,20 @@ ${lanes.join("\n")}
|
|
|
61063
61042
|
return result;
|
|
61064
61043
|
}
|
|
61065
61044
|
const moreThanOneRealChildren = length(validChildren) > 1;
|
|
61066
|
-
|
|
61067
|
-
|
|
61045
|
+
let arrayLikeTargetParts;
|
|
61046
|
+
let nonArrayLikeTargetParts;
|
|
61047
|
+
const iterableType = getGlobalIterableType(
|
|
61048
|
+
/*reportErrors*/
|
|
61049
|
+
false
|
|
61050
|
+
);
|
|
61051
|
+
if (iterableType !== emptyGenericType) {
|
|
61052
|
+
const anyIterable = createIterableType(anyType);
|
|
61053
|
+
arrayLikeTargetParts = filterType(childrenTargetType, (t) => isTypeAssignableTo(t, anyIterable));
|
|
61054
|
+
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isTypeAssignableTo(t, anyIterable));
|
|
61055
|
+
} else {
|
|
61056
|
+
arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType);
|
|
61057
|
+
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isArrayOrTupleLikeType(t));
|
|
61058
|
+
}
|
|
61068
61059
|
if (moreThanOneRealChildren) {
|
|
61069
61060
|
if (arrayLikeTargetParts !== neverType) {
|
|
61070
61061
|
const realSource = createTupleType(checkJsxChildren(containingElement, 0 /* Normal */));
|
|
@@ -64344,13 +64335,6 @@ ${lanes.join("\n")}
|
|
|
64344
64335
|
function isArrayOrTupleLikeType(type) {
|
|
64345
64336
|
return isArrayLikeType(type) || isTupleLikeType(type);
|
|
64346
64337
|
}
|
|
64347
|
-
function isAssignableToAvailableAnyIterable(type) {
|
|
64348
|
-
const anyIterable = getGlobalIterableType(
|
|
64349
|
-
/*reportErrors*/
|
|
64350
|
-
false
|
|
64351
|
-
) !== emptyGenericType && createIterableType(anyType);
|
|
64352
|
-
return anyIterable ? isTypeAssignableTo(type, anyIterable) : isArrayOrTupleLikeType(type);
|
|
64353
|
-
}
|
|
64354
64338
|
function getTupleElementType(type, index) {
|
|
64355
64339
|
const propType = getTypeOfPropertyOfType(type, "" + index);
|
|
64356
64340
|
if (propType) {
|
|
@@ -69104,7 +69088,7 @@ ${lanes.join("\n")}
|
|
|
69104
69088
|
return void 0;
|
|
69105
69089
|
}
|
|
69106
69090
|
function getContextualTypeForElementExpression(arrayContextualType, index) {
|
|
69107
|
-
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(
|
|
69091
|
+
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType(
|
|
69108
69092
|
arrayContextualType,
|
|
69109
69093
|
(t) => isTupleType(t) ? getElementTypeOfSliceOfTupleType(
|
|
69110
69094
|
t,
|
|
@@ -122832,21 +122816,22 @@ ${lanes.join("\n")}
|
|
|
122832
122816
|
updateProgram();
|
|
122833
122817
|
}
|
|
122834
122818
|
function updateProgram() {
|
|
122819
|
+
var _a2, _b, _c, _d;
|
|
122835
122820
|
switch (reloadLevel) {
|
|
122836
122821
|
case 1 /* Partial */:
|
|
122837
|
-
perfLogger.logStartUpdateProgram("PartialConfigReload");
|
|
122822
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartUpdateProgram("PartialConfigReload");
|
|
122838
122823
|
reloadFileNamesFromConfigFile();
|
|
122839
122824
|
break;
|
|
122840
122825
|
case 2 /* Full */:
|
|
122841
|
-
perfLogger.logStartUpdateProgram("FullConfigReload");
|
|
122826
|
+
(_b = perfLogger) == null ? void 0 : _b.logStartUpdateProgram("FullConfigReload");
|
|
122842
122827
|
reloadConfigFile();
|
|
122843
122828
|
break;
|
|
122844
122829
|
default:
|
|
122845
|
-
perfLogger.logStartUpdateProgram("SynchronizeProgram");
|
|
122830
|
+
(_c = perfLogger) == null ? void 0 : _c.logStartUpdateProgram("SynchronizeProgram");
|
|
122846
122831
|
synchronizeProgram();
|
|
122847
122832
|
break;
|
|
122848
122833
|
}
|
|
122849
|
-
perfLogger.logStopUpdateProgram("Done");
|
|
122834
|
+
(_d = perfLogger) == null ? void 0 : _d.logStopUpdateProgram("Done");
|
|
122850
122835
|
return getCurrentBuilderProgram();
|
|
122851
122836
|
}
|
|
122852
122837
|
function reloadFileNamesFromConfigFile() {
|