@typescript-deploys/pr-build 5.1.0-pr-52984-26 → 5.1.0-pr-53092-8
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 +10 -39
- package/lib/tsserver.js +58 -57
- package/lib/tsserverlibrary.js +58 -58
- package/lib/typescript.js +58 -58
- package/lib/typingsInstaller.js +3 -36
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.1";
|
|
26
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20230304`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -2624,41 +2624,8 @@ function tryGetWebPerformanceHooks() {
|
|
|
2624
2624
|
function tryGetNodePerformanceHooks() {
|
|
2625
2625
|
if (isNodeLikeSystem()) {
|
|
2626
2626
|
try {
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
if (hasRequiredAPI(nodePerformance, PerformanceObserver2)) {
|
|
2630
|
-
performance2 = nodePerformance;
|
|
2631
|
-
const version2 = new Version(process.versions.node);
|
|
2632
|
-
const range = new VersionRange("<12.16.3 || 13 <13.13");
|
|
2633
|
-
if (range.test(version2)) {
|
|
2634
|
-
performance2 = {
|
|
2635
|
-
get timeOrigin() {
|
|
2636
|
-
return nodePerformance.timeOrigin;
|
|
2637
|
-
},
|
|
2638
|
-
now() {
|
|
2639
|
-
return nodePerformance.now();
|
|
2640
|
-
},
|
|
2641
|
-
mark(name) {
|
|
2642
|
-
return nodePerformance.mark(name);
|
|
2643
|
-
},
|
|
2644
|
-
measure(name, start = "nodeStart", end) {
|
|
2645
|
-
if (end === void 0) {
|
|
2646
|
-
end = "__performance.measure-fix__";
|
|
2647
|
-
nodePerformance.mark(end);
|
|
2648
|
-
}
|
|
2649
|
-
nodePerformance.measure(name, start, end);
|
|
2650
|
-
if (end === "__performance.measure-fix__") {
|
|
2651
|
-
nodePerformance.clearMarks("__performance.measure-fix__");
|
|
2652
|
-
}
|
|
2653
|
-
},
|
|
2654
|
-
clearMarks(name) {
|
|
2655
|
-
return nodePerformance.clearMarks(name);
|
|
2656
|
-
},
|
|
2657
|
-
clearMeasures(name) {
|
|
2658
|
-
return nodePerformance.clearMeasures(name);
|
|
2659
|
-
}
|
|
2660
|
-
};
|
|
2661
|
-
}
|
|
2627
|
+
const { performance: performance2, PerformanceObserver: PerformanceObserver2 } = require("perf_hooks");
|
|
2628
|
+
if (hasRequiredAPI(performance2, PerformanceObserver2)) {
|
|
2662
2629
|
return {
|
|
2663
2630
|
// By default, only write native events when generating a cpu profile or using the v8 profiler.
|
|
2664
2631
|
shouldWriteNativeEvents: false,
|
|
@@ -69253,16 +69220,20 @@ function createTypeChecker(host) {
|
|
|
69253
69220
|
) : createTupleType([type], [8 /* Variadic */]);
|
|
69254
69221
|
}
|
|
69255
69222
|
function getSpreadArgumentType(args, index, argCount, restType, context, checkMode) {
|
|
69223
|
+
const inConstContext = isConstTypeVariable(restType);
|
|
69256
69224
|
if (index >= argCount - 1) {
|
|
69257
69225
|
const arg = args[argCount - 1];
|
|
69258
69226
|
if (isSpreadArgument(arg)) {
|
|
69259
|
-
|
|
69227
|
+
const spreadType = arg.kind === 234 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode);
|
|
69228
|
+
if (isArrayLikeType(spreadType)) {
|
|
69229
|
+
return getMutableArrayOrTupleType(spreadType);
|
|
69230
|
+
}
|
|
69231
|
+
return createArrayType(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 227 /* SpreadElement */ ? arg.expression : arg), inConstContext);
|
|
69260
69232
|
}
|
|
69261
69233
|
}
|
|
69262
69234
|
const types = [];
|
|
69263
69235
|
const flags = [];
|
|
69264
69236
|
const names = [];
|
|
69265
|
-
const inConstContext = isConstTypeVariable(restType);
|
|
69266
69237
|
for (let i = index; i < argCount; i++) {
|
|
69267
69238
|
const arg = args[i];
|
|
69268
69239
|
if (isSpreadArgument(arg)) {
|
|
@@ -72057,7 +72028,7 @@ function createTypeChecker(host) {
|
|
|
72057
72028
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() {
|
|
72058
72029
|
const functionFlags = getFunctionFlags(func);
|
|
72059
72030
|
const type = returnType && unwrapReturnType(returnType, functionFlags);
|
|
72060
|
-
if (type && maybeTypeOfKind(type,
|
|
72031
|
+
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */)) {
|
|
72061
72032
|
return;
|
|
72062
72033
|
}
|
|
72063
72034
|
if (func.kind === 170 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 238 /* Block */ || !functionHasImplicitReturn(func)) {
|
package/lib/tsserver.js
CHANGED
|
@@ -2286,7 +2286,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2286
2286
|
|
|
2287
2287
|
// src/compiler/corePublic.ts
|
|
2288
2288
|
var versionMajorMinor = "5.1";
|
|
2289
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2289
|
+
var version = `${versionMajorMinor}.0-insiders.20230304`;
|
|
2290
2290
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2291
2291
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2292
2292
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -5283,41 +5283,8 @@ function tryGetWebPerformanceHooks() {
|
|
|
5283
5283
|
function tryGetNodePerformanceHooks() {
|
|
5284
5284
|
if (isNodeLikeSystem()) {
|
|
5285
5285
|
try {
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
if (hasRequiredAPI(nodePerformance, PerformanceObserver2)) {
|
|
5289
|
-
performance2 = nodePerformance;
|
|
5290
|
-
const version2 = new Version(process.versions.node);
|
|
5291
|
-
const range = new VersionRange("<12.16.3 || 13 <13.13");
|
|
5292
|
-
if (range.test(version2)) {
|
|
5293
|
-
performance2 = {
|
|
5294
|
-
get timeOrigin() {
|
|
5295
|
-
return nodePerformance.timeOrigin;
|
|
5296
|
-
},
|
|
5297
|
-
now() {
|
|
5298
|
-
return nodePerformance.now();
|
|
5299
|
-
},
|
|
5300
|
-
mark(name) {
|
|
5301
|
-
return nodePerformance.mark(name);
|
|
5302
|
-
},
|
|
5303
|
-
measure(name, start2 = "nodeStart", end) {
|
|
5304
|
-
if (end === void 0) {
|
|
5305
|
-
end = "__performance.measure-fix__";
|
|
5306
|
-
nodePerformance.mark(end);
|
|
5307
|
-
}
|
|
5308
|
-
nodePerformance.measure(name, start2, end);
|
|
5309
|
-
if (end === "__performance.measure-fix__") {
|
|
5310
|
-
nodePerformance.clearMarks("__performance.measure-fix__");
|
|
5311
|
-
}
|
|
5312
|
-
},
|
|
5313
|
-
clearMarks(name) {
|
|
5314
|
-
return nodePerformance.clearMarks(name);
|
|
5315
|
-
},
|
|
5316
|
-
clearMeasures(name) {
|
|
5317
|
-
return nodePerformance.clearMeasures(name);
|
|
5318
|
-
}
|
|
5319
|
-
};
|
|
5320
|
-
}
|
|
5286
|
+
const { performance: performance2, PerformanceObserver: PerformanceObserver2 } = require("perf_hooks");
|
|
5287
|
+
if (hasRequiredAPI(performance2, PerformanceObserver2)) {
|
|
5321
5288
|
return {
|
|
5322
5289
|
// By default, only write native events when generating a cpu profile or using the v8 profiler.
|
|
5323
5290
|
shouldWriteNativeEvents: false,
|
|
@@ -73858,16 +73825,20 @@ function createTypeChecker(host) {
|
|
|
73858
73825
|
) : createTupleType([type], [8 /* Variadic */]);
|
|
73859
73826
|
}
|
|
73860
73827
|
function getSpreadArgumentType(args, index, argCount, restType, context, checkMode) {
|
|
73828
|
+
const inConstContext = isConstTypeVariable(restType);
|
|
73861
73829
|
if (index >= argCount - 1) {
|
|
73862
73830
|
const arg = args[argCount - 1];
|
|
73863
73831
|
if (isSpreadArgument(arg)) {
|
|
73864
|
-
|
|
73832
|
+
const spreadType = arg.kind === 234 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode);
|
|
73833
|
+
if (isArrayLikeType(spreadType)) {
|
|
73834
|
+
return getMutableArrayOrTupleType(spreadType);
|
|
73835
|
+
}
|
|
73836
|
+
return createArrayType(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 227 /* SpreadElement */ ? arg.expression : arg), inConstContext);
|
|
73865
73837
|
}
|
|
73866
73838
|
}
|
|
73867
73839
|
const types = [];
|
|
73868
73840
|
const flags = [];
|
|
73869
73841
|
const names = [];
|
|
73870
|
-
const inConstContext = isConstTypeVariable(restType);
|
|
73871
73842
|
for (let i = index; i < argCount; i++) {
|
|
73872
73843
|
const arg = args[i];
|
|
73873
73844
|
if (isSpreadArgument(arg)) {
|
|
@@ -76662,7 +76633,7 @@ function createTypeChecker(host) {
|
|
|
76662
76633
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() {
|
|
76663
76634
|
const functionFlags = getFunctionFlags(func);
|
|
76664
76635
|
const type = returnType && unwrapReturnType(returnType, functionFlags);
|
|
76665
|
-
if (type && maybeTypeOfKind(type,
|
|
76636
|
+
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */)) {
|
|
76666
76637
|
return;
|
|
76667
76638
|
}
|
|
76668
76639
|
if (func.kind === 170 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 238 /* Block */ || !functionHasImplicitReturn(func)) {
|
|
@@ -138746,6 +138717,7 @@ function createCodeFixActionWorker(fixName8, description2, changes, fixId52, fix
|
|
|
138746
138717
|
}
|
|
138747
138718
|
function registerCodeFix(reg) {
|
|
138748
138719
|
for (const error of reg.errorCodes) {
|
|
138720
|
+
errorCodeToFixesArray = void 0;
|
|
138749
138721
|
errorCodeToFixes.add(String(error), reg);
|
|
138750
138722
|
}
|
|
138751
138723
|
if (reg.fixIds) {
|
|
@@ -138755,8 +138727,9 @@ function registerCodeFix(reg) {
|
|
|
138755
138727
|
}
|
|
138756
138728
|
}
|
|
138757
138729
|
}
|
|
138730
|
+
var errorCodeToFixesArray;
|
|
138758
138731
|
function getSupportedErrorCodes() {
|
|
138759
|
-
return arrayFrom(errorCodeToFixes.keys());
|
|
138732
|
+
return errorCodeToFixesArray != null ? errorCodeToFixesArray : errorCodeToFixesArray = arrayFrom(errorCodeToFixes.keys());
|
|
138760
138733
|
}
|
|
138761
138734
|
function removeFixIdIfFixAllUnavailable(registration, diagnostics) {
|
|
138762
138735
|
const { errorCodes: errorCodes64 } = registration;
|
|
@@ -151467,6 +151440,8 @@ function tryGetObjectLikeCompletionContainer(contextToken) {
|
|
|
151467
151440
|
break;
|
|
151468
151441
|
case 41 /* AsteriskToken */:
|
|
151469
151442
|
return isMethodDeclaration(parent2) ? tryCast(parent2.parent, isObjectLiteralExpression) : void 0;
|
|
151443
|
+
case 132 /* AsyncKeyword */:
|
|
151444
|
+
return tryCast(parent2.parent, isObjectLiteralExpression);
|
|
151470
151445
|
case 79 /* Identifier */:
|
|
151471
151446
|
return contextToken.text === "async" && isShorthandPropertyAssignment(contextToken.parent) ? contextToken.parent.parent : void 0;
|
|
151472
151447
|
}
|
|
@@ -156487,7 +156462,7 @@ function organizeImports(sourceFile, formatContext, host, program, preferences,
|
|
|
156487
156462
|
const shouldSort = mode === "SortAndCombine" /* SortAndCombine */ || mode === "All" /* All */;
|
|
156488
156463
|
const shouldCombine = shouldSort;
|
|
156489
156464
|
const shouldRemove = mode === "RemoveUnused" /* RemoveUnused */ || mode === "All" /* All */;
|
|
156490
|
-
const topLevelImportGroupDecls =
|
|
156465
|
+
const topLevelImportGroupDecls = groupByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration));
|
|
156491
156466
|
const comparer = getOrganizeImportsComparerWithDetection(preferences, shouldSort ? () => detectSortingWorker(topLevelImportGroupDecls, preferences) === 2 /* CaseInsensitive */ : void 0);
|
|
156492
156467
|
const processImportsOfSameModuleSpecifier = (importGroup) => {
|
|
156493
156468
|
if (shouldRemove)
|
|
@@ -156500,13 +156475,12 @@ function organizeImports(sourceFile, formatContext, host, program, preferences,
|
|
|
156500
156475
|
};
|
|
156501
156476
|
topLevelImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier));
|
|
156502
156477
|
if (mode !== "RemoveUnused" /* RemoveUnused */) {
|
|
156503
|
-
|
|
156504
|
-
organizeImportsWorker(topLevelExportDecls, (group2) => coalesceExportsWorker(group2, comparer));
|
|
156478
|
+
getTopLevelExportGroups(sourceFile).forEach((exportGroupDecl) => organizeImportsWorker(exportGroupDecl, (group2) => coalesceExportsWorker(group2, comparer)));
|
|
156505
156479
|
}
|
|
156506
156480
|
for (const ambientModule of sourceFile.statements.filter(isAmbientModule)) {
|
|
156507
156481
|
if (!ambientModule.body)
|
|
156508
156482
|
continue;
|
|
156509
|
-
const ambientModuleImportGroupDecls =
|
|
156483
|
+
const ambientModuleImportGroupDecls = groupByNewlineContiguous(sourceFile, ambientModule.body.statements.filter(isImportDeclaration));
|
|
156510
156484
|
ambientModuleImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier));
|
|
156511
156485
|
if (mode !== "RemoveUnused" /* RemoveUnused */) {
|
|
156512
156486
|
const ambientModuleExportDecls = ambientModule.body.statements.filter(isExportDeclaration);
|
|
@@ -156521,7 +156495,7 @@ function organizeImports(sourceFile, formatContext, host, program, preferences,
|
|
|
156521
156495
|
suppressLeadingTrivia(oldImportDecls[0]);
|
|
156522
156496
|
const oldImportGroups = shouldCombine ? group(oldImportDecls, (importDecl) => getExternalModuleName2(importDecl.moduleSpecifier)) : [oldImportDecls];
|
|
156523
156497
|
const sortedImportGroups = shouldSort ? stableSort(oldImportGroups, (group1, group2) => compareModuleSpecifiersWorker(group1[0].moduleSpecifier, group2[0].moduleSpecifier, comparer)) : oldImportGroups;
|
|
156524
|
-
const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) ? coalesce(importGroup) : importGroup);
|
|
156498
|
+
const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) || importGroup[0].moduleSpecifier === void 0 ? coalesce(importGroup) : importGroup);
|
|
156525
156499
|
if (newImportDecls.length === 0) {
|
|
156526
156500
|
changeTracker.deleteNodes(
|
|
156527
156501
|
sourceFile,
|
|
@@ -156548,29 +156522,29 @@ function organizeImports(sourceFile, formatContext, host, program, preferences,
|
|
|
156548
156522
|
}
|
|
156549
156523
|
}
|
|
156550
156524
|
}
|
|
156551
|
-
function
|
|
156525
|
+
function groupByNewlineContiguous(sourceFile, decls) {
|
|
156552
156526
|
const scanner2 = createScanner(
|
|
156553
156527
|
sourceFile.languageVersion,
|
|
156554
156528
|
/*skipTrivia*/
|
|
156555
156529
|
false,
|
|
156556
156530
|
sourceFile.languageVariant
|
|
156557
156531
|
);
|
|
156558
|
-
const
|
|
156532
|
+
const group2 = [];
|
|
156559
156533
|
let groupIndex = 0;
|
|
156560
|
-
for (const
|
|
156561
|
-
if (
|
|
156534
|
+
for (const decl of decls) {
|
|
156535
|
+
if (group2[groupIndex] && isNewGroup(sourceFile, decl, scanner2)) {
|
|
156562
156536
|
groupIndex++;
|
|
156563
156537
|
}
|
|
156564
|
-
if (!
|
|
156565
|
-
|
|
156538
|
+
if (!group2[groupIndex]) {
|
|
156539
|
+
group2[groupIndex] = [];
|
|
156566
156540
|
}
|
|
156567
|
-
|
|
156541
|
+
group2[groupIndex].push(decl);
|
|
156568
156542
|
}
|
|
156569
|
-
return
|
|
156543
|
+
return group2;
|
|
156570
156544
|
}
|
|
156571
|
-
function isNewGroup(sourceFile,
|
|
156572
|
-
const startPos =
|
|
156573
|
-
const endPos =
|
|
156545
|
+
function isNewGroup(sourceFile, decl, scanner2) {
|
|
156546
|
+
const startPos = decl.getFullStart();
|
|
156547
|
+
const endPos = decl.getStart();
|
|
156574
156548
|
scanner2.setText(sourceFile.text, startPos, endPos - startPos);
|
|
156575
156549
|
let numberOfNewLines = 0;
|
|
156576
156550
|
while (scanner2.getTokenPos() < endPos) {
|
|
@@ -156851,7 +156825,7 @@ function getModuleSpecifierExpression(declaration) {
|
|
|
156851
156825
|
}
|
|
156852
156826
|
function detectSorting(sourceFile, preferences) {
|
|
156853
156827
|
return detectSortingWorker(
|
|
156854
|
-
|
|
156828
|
+
groupByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration)),
|
|
156855
156829
|
preferences
|
|
156856
156830
|
);
|
|
156857
156831
|
}
|
|
@@ -157055,6 +157029,33 @@ function getOrganizeImportsComparerWithDetection(preferences, detectIgnoreCase)
|
|
|
157055
157029
|
const ignoreCase = typeof preferences.organizeImportsIgnoreCase === "boolean" ? preferences.organizeImportsIgnoreCase : (_a2 = detectIgnoreCase == null ? void 0 : detectIgnoreCase()) != null ? _a2 : false;
|
|
157056
157030
|
return getOrganizeImportsComparer(preferences, ignoreCase);
|
|
157057
157031
|
}
|
|
157032
|
+
function getTopLevelExportGroups(sourceFile) {
|
|
157033
|
+
const topLevelExportGroups = [];
|
|
157034
|
+
const statements = sourceFile.statements;
|
|
157035
|
+
const len = length(statements);
|
|
157036
|
+
let i = 0;
|
|
157037
|
+
let groupIndex = 0;
|
|
157038
|
+
while (i < len) {
|
|
157039
|
+
if (isExportDeclaration(statements[i])) {
|
|
157040
|
+
if (topLevelExportGroups[groupIndex] === void 0) {
|
|
157041
|
+
topLevelExportGroups[groupIndex] = [];
|
|
157042
|
+
}
|
|
157043
|
+
const exportDecl = statements[i];
|
|
157044
|
+
if (exportDecl.moduleSpecifier) {
|
|
157045
|
+
topLevelExportGroups[groupIndex].push(exportDecl);
|
|
157046
|
+
i++;
|
|
157047
|
+
} else {
|
|
157048
|
+
while (i < len && isExportDeclaration(statements[i])) {
|
|
157049
|
+
topLevelExportGroups[groupIndex].push(statements[i++]);
|
|
157050
|
+
}
|
|
157051
|
+
groupIndex++;
|
|
157052
|
+
}
|
|
157053
|
+
} else {
|
|
157054
|
+
i++;
|
|
157055
|
+
}
|
|
157056
|
+
}
|
|
157057
|
+
return flatMap(topLevelExportGroups, (exportGroupDecls) => groupByNewlineContiguous(sourceFile, exportGroupDecls));
|
|
157058
|
+
}
|
|
157058
157059
|
|
|
157059
157060
|
// src/services/_namespaces/ts.OutliningElementsCollector.ts
|
|
157060
157061
|
var ts_OutliningElementsCollector_exports = {};
|
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.20230304`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3053,41 +3053,8 @@ ${lanes.join("\n")}
|
|
|
3053
3053
|
function tryGetNodePerformanceHooks() {
|
|
3054
3054
|
if (isNodeLikeSystem()) {
|
|
3055
3055
|
try {
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
if (hasRequiredAPI(nodePerformance, PerformanceObserver2)) {
|
|
3059
|
-
performance2 = nodePerformance;
|
|
3060
|
-
const version2 = new Version(process.versions.node);
|
|
3061
|
-
const range = new VersionRange("<12.16.3 || 13 <13.13");
|
|
3062
|
-
if (range.test(version2)) {
|
|
3063
|
-
performance2 = {
|
|
3064
|
-
get timeOrigin() {
|
|
3065
|
-
return nodePerformance.timeOrigin;
|
|
3066
|
-
},
|
|
3067
|
-
now() {
|
|
3068
|
-
return nodePerformance.now();
|
|
3069
|
-
},
|
|
3070
|
-
mark(name) {
|
|
3071
|
-
return nodePerformance.mark(name);
|
|
3072
|
-
},
|
|
3073
|
-
measure(name, start = "nodeStart", end) {
|
|
3074
|
-
if (end === void 0) {
|
|
3075
|
-
end = "__performance.measure-fix__";
|
|
3076
|
-
nodePerformance.mark(end);
|
|
3077
|
-
}
|
|
3078
|
-
nodePerformance.measure(name, start, end);
|
|
3079
|
-
if (end === "__performance.measure-fix__") {
|
|
3080
|
-
nodePerformance.clearMarks("__performance.measure-fix__");
|
|
3081
|
-
}
|
|
3082
|
-
},
|
|
3083
|
-
clearMarks(name) {
|
|
3084
|
-
return nodePerformance.clearMarks(name);
|
|
3085
|
-
},
|
|
3086
|
-
clearMeasures(name) {
|
|
3087
|
-
return nodePerformance.clearMeasures(name);
|
|
3088
|
-
}
|
|
3089
|
-
};
|
|
3090
|
-
}
|
|
3056
|
+
const { performance: performance2, PerformanceObserver: PerformanceObserver2 } = require("perf_hooks");
|
|
3057
|
+
if (hasRequiredAPI(performance2, PerformanceObserver2)) {
|
|
3091
3058
|
return {
|
|
3092
3059
|
// By default, only write native events when generating a cpu profile or using the v8 profiler.
|
|
3093
3060
|
shouldWriteNativeEvents: false,
|
|
@@ -71668,16 +71635,20 @@ ${lanes.join("\n")}
|
|
|
71668
71635
|
) : createTupleType([type], [8 /* Variadic */]);
|
|
71669
71636
|
}
|
|
71670
71637
|
function getSpreadArgumentType(args, index, argCount, restType, context, checkMode) {
|
|
71638
|
+
const inConstContext = isConstTypeVariable(restType);
|
|
71671
71639
|
if (index >= argCount - 1) {
|
|
71672
71640
|
const arg = args[argCount - 1];
|
|
71673
71641
|
if (isSpreadArgument(arg)) {
|
|
71674
|
-
|
|
71642
|
+
const spreadType = arg.kind === 234 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode);
|
|
71643
|
+
if (isArrayLikeType(spreadType)) {
|
|
71644
|
+
return getMutableArrayOrTupleType(spreadType);
|
|
71645
|
+
}
|
|
71646
|
+
return createArrayType(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 227 /* SpreadElement */ ? arg.expression : arg), inConstContext);
|
|
71675
71647
|
}
|
|
71676
71648
|
}
|
|
71677
71649
|
const types = [];
|
|
71678
71650
|
const flags = [];
|
|
71679
71651
|
const names = [];
|
|
71680
|
-
const inConstContext = isConstTypeVariable(restType);
|
|
71681
71652
|
for (let i = index; i < argCount; i++) {
|
|
71682
71653
|
const arg = args[i];
|
|
71683
71654
|
if (isSpreadArgument(arg)) {
|
|
@@ -74472,7 +74443,7 @@ ${lanes.join("\n")}
|
|
|
74472
74443
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() {
|
|
74473
74444
|
const functionFlags = getFunctionFlags(func);
|
|
74474
74445
|
const type = returnType && unwrapReturnType(returnType, functionFlags);
|
|
74475
|
-
if (type && maybeTypeOfKind(type,
|
|
74446
|
+
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */)) {
|
|
74476
74447
|
return;
|
|
74477
74448
|
}
|
|
74478
74449
|
if (func.kind === 170 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 238 /* Block */ || !functionHasImplicitReturn(func)) {
|
|
@@ -137200,6 +137171,7 @@ ${lanes.join("\n")}
|
|
|
137200
137171
|
}
|
|
137201
137172
|
function registerCodeFix(reg) {
|
|
137202
137173
|
for (const error of reg.errorCodes) {
|
|
137174
|
+
errorCodeToFixesArray = void 0;
|
|
137203
137175
|
errorCodeToFixes.add(String(error), reg);
|
|
137204
137176
|
}
|
|
137205
137177
|
if (reg.fixIds) {
|
|
@@ -137210,7 +137182,7 @@ ${lanes.join("\n")}
|
|
|
137210
137182
|
}
|
|
137211
137183
|
}
|
|
137212
137184
|
function getSupportedErrorCodes() {
|
|
137213
|
-
return arrayFrom(errorCodeToFixes.keys());
|
|
137185
|
+
return errorCodeToFixesArray != null ? errorCodeToFixesArray : errorCodeToFixesArray = arrayFrom(errorCodeToFixes.keys());
|
|
137214
137186
|
}
|
|
137215
137187
|
function removeFixIdIfFixAllUnavailable(registration, diagnostics) {
|
|
137216
137188
|
const { errorCodes: errorCodes64 } = registration;
|
|
@@ -137259,7 +137231,7 @@ ${lanes.join("\n")}
|
|
|
137259
137231
|
...computeSuggestionDiagnostics(sourceFile, program, cancellationToken)
|
|
137260
137232
|
];
|
|
137261
137233
|
}
|
|
137262
|
-
var errorCodeToFixes, fixIdToRegistration;
|
|
137234
|
+
var errorCodeToFixes, fixIdToRegistration, errorCodeToFixesArray;
|
|
137263
137235
|
var init_codeFixProvider = __esm({
|
|
137264
137236
|
"src/services/codeFixProvider.ts"() {
|
|
137265
137237
|
"use strict";
|
|
@@ -150521,6 +150493,8 @@ ${lanes.join("\n")}
|
|
|
150521
150493
|
break;
|
|
150522
150494
|
case 41 /* AsteriskToken */:
|
|
150523
150495
|
return isMethodDeclaration(parent2) ? tryCast(parent2.parent, isObjectLiteralExpression) : void 0;
|
|
150496
|
+
case 132 /* AsyncKeyword */:
|
|
150497
|
+
return tryCast(parent2.parent, isObjectLiteralExpression);
|
|
150524
150498
|
case 79 /* Identifier */:
|
|
150525
150499
|
return contextToken.text === "async" && isShorthandPropertyAssignment(contextToken.parent) ? contextToken.parent.parent : void 0;
|
|
150526
150500
|
}
|
|
@@ -155685,7 +155659,7 @@ ${lanes.join("\n")}
|
|
|
155685
155659
|
const shouldSort = mode === "SortAndCombine" /* SortAndCombine */ || mode === "All" /* All */;
|
|
155686
155660
|
const shouldCombine = shouldSort;
|
|
155687
155661
|
const shouldRemove = mode === "RemoveUnused" /* RemoveUnused */ || mode === "All" /* All */;
|
|
155688
|
-
const topLevelImportGroupDecls =
|
|
155662
|
+
const topLevelImportGroupDecls = groupByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration));
|
|
155689
155663
|
const comparer = getOrganizeImportsComparerWithDetection(preferences, shouldSort ? () => detectSortingWorker(topLevelImportGroupDecls, preferences) === 2 /* CaseInsensitive */ : void 0);
|
|
155690
155664
|
const processImportsOfSameModuleSpecifier = (importGroup) => {
|
|
155691
155665
|
if (shouldRemove)
|
|
@@ -155698,13 +155672,12 @@ ${lanes.join("\n")}
|
|
|
155698
155672
|
};
|
|
155699
155673
|
topLevelImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier));
|
|
155700
155674
|
if (mode !== "RemoveUnused" /* RemoveUnused */) {
|
|
155701
|
-
|
|
155702
|
-
organizeImportsWorker(topLevelExportDecls, (group2) => coalesceExportsWorker(group2, comparer));
|
|
155675
|
+
getTopLevelExportGroups(sourceFile).forEach((exportGroupDecl) => organizeImportsWorker(exportGroupDecl, (group2) => coalesceExportsWorker(group2, comparer)));
|
|
155703
155676
|
}
|
|
155704
155677
|
for (const ambientModule of sourceFile.statements.filter(isAmbientModule)) {
|
|
155705
155678
|
if (!ambientModule.body)
|
|
155706
155679
|
continue;
|
|
155707
|
-
const ambientModuleImportGroupDecls =
|
|
155680
|
+
const ambientModuleImportGroupDecls = groupByNewlineContiguous(sourceFile, ambientModule.body.statements.filter(isImportDeclaration));
|
|
155708
155681
|
ambientModuleImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier));
|
|
155709
155682
|
if (mode !== "RemoveUnused" /* RemoveUnused */) {
|
|
155710
155683
|
const ambientModuleExportDecls = ambientModule.body.statements.filter(isExportDeclaration);
|
|
@@ -155719,7 +155692,7 @@ ${lanes.join("\n")}
|
|
|
155719
155692
|
suppressLeadingTrivia(oldImportDecls[0]);
|
|
155720
155693
|
const oldImportGroups = shouldCombine ? group(oldImportDecls, (importDecl) => getExternalModuleName2(importDecl.moduleSpecifier)) : [oldImportDecls];
|
|
155721
155694
|
const sortedImportGroups = shouldSort ? stableSort(oldImportGroups, (group1, group2) => compareModuleSpecifiersWorker(group1[0].moduleSpecifier, group2[0].moduleSpecifier, comparer)) : oldImportGroups;
|
|
155722
|
-
const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) ? coalesce(importGroup) : importGroup);
|
|
155695
|
+
const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) || importGroup[0].moduleSpecifier === void 0 ? coalesce(importGroup) : importGroup);
|
|
155723
155696
|
if (newImportDecls.length === 0) {
|
|
155724
155697
|
changeTracker.deleteNodes(
|
|
155725
155698
|
sourceFile,
|
|
@@ -155746,29 +155719,29 @@ ${lanes.join("\n")}
|
|
|
155746
155719
|
}
|
|
155747
155720
|
}
|
|
155748
155721
|
}
|
|
155749
|
-
function
|
|
155722
|
+
function groupByNewlineContiguous(sourceFile, decls) {
|
|
155750
155723
|
const scanner2 = createScanner(
|
|
155751
155724
|
sourceFile.languageVersion,
|
|
155752
155725
|
/*skipTrivia*/
|
|
155753
155726
|
false,
|
|
155754
155727
|
sourceFile.languageVariant
|
|
155755
155728
|
);
|
|
155756
|
-
const
|
|
155729
|
+
const group2 = [];
|
|
155757
155730
|
let groupIndex = 0;
|
|
155758
|
-
for (const
|
|
155759
|
-
if (
|
|
155731
|
+
for (const decl of decls) {
|
|
155732
|
+
if (group2[groupIndex] && isNewGroup(sourceFile, decl, scanner2)) {
|
|
155760
155733
|
groupIndex++;
|
|
155761
155734
|
}
|
|
155762
|
-
if (!
|
|
155763
|
-
|
|
155735
|
+
if (!group2[groupIndex]) {
|
|
155736
|
+
group2[groupIndex] = [];
|
|
155764
155737
|
}
|
|
155765
|
-
|
|
155738
|
+
group2[groupIndex].push(decl);
|
|
155766
155739
|
}
|
|
155767
|
-
return
|
|
155740
|
+
return group2;
|
|
155768
155741
|
}
|
|
155769
|
-
function isNewGroup(sourceFile,
|
|
155770
|
-
const startPos =
|
|
155771
|
-
const endPos =
|
|
155742
|
+
function isNewGroup(sourceFile, decl, scanner2) {
|
|
155743
|
+
const startPos = decl.getFullStart();
|
|
155744
|
+
const endPos = decl.getStart();
|
|
155772
155745
|
scanner2.setText(sourceFile.text, startPos, endPos - startPos);
|
|
155773
155746
|
let numberOfNewLines = 0;
|
|
155774
155747
|
while (scanner2.getTokenPos() < endPos) {
|
|
@@ -156049,7 +156022,7 @@ ${lanes.join("\n")}
|
|
|
156049
156022
|
}
|
|
156050
156023
|
function detectSorting(sourceFile, preferences) {
|
|
156051
156024
|
return detectSortingWorker(
|
|
156052
|
-
|
|
156025
|
+
groupByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration)),
|
|
156053
156026
|
preferences
|
|
156054
156027
|
);
|
|
156055
156028
|
}
|
|
@@ -156216,6 +156189,33 @@ ${lanes.join("\n")}
|
|
|
156216
156189
|
const ignoreCase = typeof preferences.organizeImportsIgnoreCase === "boolean" ? preferences.organizeImportsIgnoreCase : (_a2 = detectIgnoreCase == null ? void 0 : detectIgnoreCase()) != null ? _a2 : false;
|
|
156217
156190
|
return getOrganizeImportsComparer(preferences, ignoreCase);
|
|
156218
156191
|
}
|
|
156192
|
+
function getTopLevelExportGroups(sourceFile) {
|
|
156193
|
+
const topLevelExportGroups = [];
|
|
156194
|
+
const statements = sourceFile.statements;
|
|
156195
|
+
const len = length(statements);
|
|
156196
|
+
let i = 0;
|
|
156197
|
+
let groupIndex = 0;
|
|
156198
|
+
while (i < len) {
|
|
156199
|
+
if (isExportDeclaration(statements[i])) {
|
|
156200
|
+
if (topLevelExportGroups[groupIndex] === void 0) {
|
|
156201
|
+
topLevelExportGroups[groupIndex] = [];
|
|
156202
|
+
}
|
|
156203
|
+
const exportDecl = statements[i];
|
|
156204
|
+
if (exportDecl.moduleSpecifier) {
|
|
156205
|
+
topLevelExportGroups[groupIndex].push(exportDecl);
|
|
156206
|
+
i++;
|
|
156207
|
+
} else {
|
|
156208
|
+
while (i < len && isExportDeclaration(statements[i])) {
|
|
156209
|
+
topLevelExportGroups[groupIndex].push(statements[i++]);
|
|
156210
|
+
}
|
|
156211
|
+
groupIndex++;
|
|
156212
|
+
}
|
|
156213
|
+
} else {
|
|
156214
|
+
i++;
|
|
156215
|
+
}
|
|
156216
|
+
}
|
|
156217
|
+
return flatMap(topLevelExportGroups, (exportGroupDecls) => groupByNewlineContiguous(sourceFile, exportGroupDecls));
|
|
156218
|
+
}
|
|
156219
156219
|
var ImportSpecifierSortingCache, detectImportSpecifierSorting;
|
|
156220
156220
|
var init_organizeImports = __esm({
|
|
156221
156221
|
"src/services/organizeImports.ts"() {
|
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.20230304`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3053,41 +3053,8 @@ ${lanes.join("\n")}
|
|
|
3053
3053
|
function tryGetNodePerformanceHooks() {
|
|
3054
3054
|
if (isNodeLikeSystem()) {
|
|
3055
3055
|
try {
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
if (hasRequiredAPI(nodePerformance, PerformanceObserver2)) {
|
|
3059
|
-
performance2 = nodePerformance;
|
|
3060
|
-
const version2 = new Version(process.versions.node);
|
|
3061
|
-
const range = new VersionRange("<12.16.3 || 13 <13.13");
|
|
3062
|
-
if (range.test(version2)) {
|
|
3063
|
-
performance2 = {
|
|
3064
|
-
get timeOrigin() {
|
|
3065
|
-
return nodePerformance.timeOrigin;
|
|
3066
|
-
},
|
|
3067
|
-
now() {
|
|
3068
|
-
return nodePerformance.now();
|
|
3069
|
-
},
|
|
3070
|
-
mark(name) {
|
|
3071
|
-
return nodePerformance.mark(name);
|
|
3072
|
-
},
|
|
3073
|
-
measure(name, start = "nodeStart", end) {
|
|
3074
|
-
if (end === void 0) {
|
|
3075
|
-
end = "__performance.measure-fix__";
|
|
3076
|
-
nodePerformance.mark(end);
|
|
3077
|
-
}
|
|
3078
|
-
nodePerformance.measure(name, start, end);
|
|
3079
|
-
if (end === "__performance.measure-fix__") {
|
|
3080
|
-
nodePerformance.clearMarks("__performance.measure-fix__");
|
|
3081
|
-
}
|
|
3082
|
-
},
|
|
3083
|
-
clearMarks(name) {
|
|
3084
|
-
return nodePerformance.clearMarks(name);
|
|
3085
|
-
},
|
|
3086
|
-
clearMeasures(name) {
|
|
3087
|
-
return nodePerformance.clearMeasures(name);
|
|
3088
|
-
}
|
|
3089
|
-
};
|
|
3090
|
-
}
|
|
3056
|
+
const { performance: performance2, PerformanceObserver: PerformanceObserver2 } = require("perf_hooks");
|
|
3057
|
+
if (hasRequiredAPI(performance2, PerformanceObserver2)) {
|
|
3091
3058
|
return {
|
|
3092
3059
|
// By default, only write native events when generating a cpu profile or using the v8 profiler.
|
|
3093
3060
|
shouldWriteNativeEvents: false,
|
|
@@ -71668,16 +71635,20 @@ ${lanes.join("\n")}
|
|
|
71668
71635
|
) : createTupleType([type], [8 /* Variadic */]);
|
|
71669
71636
|
}
|
|
71670
71637
|
function getSpreadArgumentType(args, index, argCount, restType, context, checkMode) {
|
|
71638
|
+
const inConstContext = isConstTypeVariable(restType);
|
|
71671
71639
|
if (index >= argCount - 1) {
|
|
71672
71640
|
const arg = args[argCount - 1];
|
|
71673
71641
|
if (isSpreadArgument(arg)) {
|
|
71674
|
-
|
|
71642
|
+
const spreadType = arg.kind === 234 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode);
|
|
71643
|
+
if (isArrayLikeType(spreadType)) {
|
|
71644
|
+
return getMutableArrayOrTupleType(spreadType);
|
|
71645
|
+
}
|
|
71646
|
+
return createArrayType(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 227 /* SpreadElement */ ? arg.expression : arg), inConstContext);
|
|
71675
71647
|
}
|
|
71676
71648
|
}
|
|
71677
71649
|
const types = [];
|
|
71678
71650
|
const flags = [];
|
|
71679
71651
|
const names = [];
|
|
71680
|
-
const inConstContext = isConstTypeVariable(restType);
|
|
71681
71652
|
for (let i = index; i < argCount; i++) {
|
|
71682
71653
|
const arg = args[i];
|
|
71683
71654
|
if (isSpreadArgument(arg)) {
|
|
@@ -74472,7 +74443,7 @@ ${lanes.join("\n")}
|
|
|
74472
74443
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() {
|
|
74473
74444
|
const functionFlags = getFunctionFlags(func);
|
|
74474
74445
|
const type = returnType && unwrapReturnType(returnType, functionFlags);
|
|
74475
|
-
if (type && maybeTypeOfKind(type,
|
|
74446
|
+
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */)) {
|
|
74476
74447
|
return;
|
|
74477
74448
|
}
|
|
74478
74449
|
if (func.kind === 170 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 238 /* Block */ || !functionHasImplicitReturn(func)) {
|
|
@@ -137214,6 +137185,7 @@ ${lanes.join("\n")}
|
|
|
137214
137185
|
}
|
|
137215
137186
|
function registerCodeFix(reg) {
|
|
137216
137187
|
for (const error of reg.errorCodes) {
|
|
137188
|
+
errorCodeToFixesArray = void 0;
|
|
137217
137189
|
errorCodeToFixes.add(String(error), reg);
|
|
137218
137190
|
}
|
|
137219
137191
|
if (reg.fixIds) {
|
|
@@ -137224,7 +137196,7 @@ ${lanes.join("\n")}
|
|
|
137224
137196
|
}
|
|
137225
137197
|
}
|
|
137226
137198
|
function getSupportedErrorCodes() {
|
|
137227
|
-
return arrayFrom(errorCodeToFixes.keys());
|
|
137199
|
+
return errorCodeToFixesArray != null ? errorCodeToFixesArray : errorCodeToFixesArray = arrayFrom(errorCodeToFixes.keys());
|
|
137228
137200
|
}
|
|
137229
137201
|
function removeFixIdIfFixAllUnavailable(registration, diagnostics) {
|
|
137230
137202
|
const { errorCodes: errorCodes64 } = registration;
|
|
@@ -137273,7 +137245,7 @@ ${lanes.join("\n")}
|
|
|
137273
137245
|
...computeSuggestionDiagnostics(sourceFile, program, cancellationToken)
|
|
137274
137246
|
];
|
|
137275
137247
|
}
|
|
137276
|
-
var errorCodeToFixes, fixIdToRegistration;
|
|
137248
|
+
var errorCodeToFixes, fixIdToRegistration, errorCodeToFixesArray;
|
|
137277
137249
|
var init_codeFixProvider = __esm({
|
|
137278
137250
|
"src/services/codeFixProvider.ts"() {
|
|
137279
137251
|
"use strict";
|
|
@@ -150535,6 +150507,8 @@ ${lanes.join("\n")}
|
|
|
150535
150507
|
break;
|
|
150536
150508
|
case 41 /* AsteriskToken */:
|
|
150537
150509
|
return isMethodDeclaration(parent2) ? tryCast(parent2.parent, isObjectLiteralExpression) : void 0;
|
|
150510
|
+
case 132 /* AsyncKeyword */:
|
|
150511
|
+
return tryCast(parent2.parent, isObjectLiteralExpression);
|
|
150538
150512
|
case 79 /* Identifier */:
|
|
150539
150513
|
return contextToken.text === "async" && isShorthandPropertyAssignment(contextToken.parent) ? contextToken.parent.parent : void 0;
|
|
150540
150514
|
}
|
|
@@ -155699,7 +155673,7 @@ ${lanes.join("\n")}
|
|
|
155699
155673
|
const shouldSort = mode === "SortAndCombine" /* SortAndCombine */ || mode === "All" /* All */;
|
|
155700
155674
|
const shouldCombine = shouldSort;
|
|
155701
155675
|
const shouldRemove = mode === "RemoveUnused" /* RemoveUnused */ || mode === "All" /* All */;
|
|
155702
|
-
const topLevelImportGroupDecls =
|
|
155676
|
+
const topLevelImportGroupDecls = groupByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration));
|
|
155703
155677
|
const comparer = getOrganizeImportsComparerWithDetection(preferences, shouldSort ? () => detectSortingWorker(topLevelImportGroupDecls, preferences) === 2 /* CaseInsensitive */ : void 0);
|
|
155704
155678
|
const processImportsOfSameModuleSpecifier = (importGroup) => {
|
|
155705
155679
|
if (shouldRemove)
|
|
@@ -155712,13 +155686,12 @@ ${lanes.join("\n")}
|
|
|
155712
155686
|
};
|
|
155713
155687
|
topLevelImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier));
|
|
155714
155688
|
if (mode !== "RemoveUnused" /* RemoveUnused */) {
|
|
155715
|
-
|
|
155716
|
-
organizeImportsWorker(topLevelExportDecls, (group2) => coalesceExportsWorker(group2, comparer));
|
|
155689
|
+
getTopLevelExportGroups(sourceFile).forEach((exportGroupDecl) => organizeImportsWorker(exportGroupDecl, (group2) => coalesceExportsWorker(group2, comparer)));
|
|
155717
155690
|
}
|
|
155718
155691
|
for (const ambientModule of sourceFile.statements.filter(isAmbientModule)) {
|
|
155719
155692
|
if (!ambientModule.body)
|
|
155720
155693
|
continue;
|
|
155721
|
-
const ambientModuleImportGroupDecls =
|
|
155694
|
+
const ambientModuleImportGroupDecls = groupByNewlineContiguous(sourceFile, ambientModule.body.statements.filter(isImportDeclaration));
|
|
155722
155695
|
ambientModuleImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier));
|
|
155723
155696
|
if (mode !== "RemoveUnused" /* RemoveUnused */) {
|
|
155724
155697
|
const ambientModuleExportDecls = ambientModule.body.statements.filter(isExportDeclaration);
|
|
@@ -155733,7 +155706,7 @@ ${lanes.join("\n")}
|
|
|
155733
155706
|
suppressLeadingTrivia(oldImportDecls[0]);
|
|
155734
155707
|
const oldImportGroups = shouldCombine ? group(oldImportDecls, (importDecl) => getExternalModuleName2(importDecl.moduleSpecifier)) : [oldImportDecls];
|
|
155735
155708
|
const sortedImportGroups = shouldSort ? stableSort(oldImportGroups, (group1, group2) => compareModuleSpecifiersWorker(group1[0].moduleSpecifier, group2[0].moduleSpecifier, comparer)) : oldImportGroups;
|
|
155736
|
-
const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) ? coalesce(importGroup) : importGroup);
|
|
155709
|
+
const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) || importGroup[0].moduleSpecifier === void 0 ? coalesce(importGroup) : importGroup);
|
|
155737
155710
|
if (newImportDecls.length === 0) {
|
|
155738
155711
|
changeTracker.deleteNodes(
|
|
155739
155712
|
sourceFile,
|
|
@@ -155760,29 +155733,29 @@ ${lanes.join("\n")}
|
|
|
155760
155733
|
}
|
|
155761
155734
|
}
|
|
155762
155735
|
}
|
|
155763
|
-
function
|
|
155736
|
+
function groupByNewlineContiguous(sourceFile, decls) {
|
|
155764
155737
|
const scanner2 = createScanner(
|
|
155765
155738
|
sourceFile.languageVersion,
|
|
155766
155739
|
/*skipTrivia*/
|
|
155767
155740
|
false,
|
|
155768
155741
|
sourceFile.languageVariant
|
|
155769
155742
|
);
|
|
155770
|
-
const
|
|
155743
|
+
const group2 = [];
|
|
155771
155744
|
let groupIndex = 0;
|
|
155772
|
-
for (const
|
|
155773
|
-
if (
|
|
155745
|
+
for (const decl of decls) {
|
|
155746
|
+
if (group2[groupIndex] && isNewGroup(sourceFile, decl, scanner2)) {
|
|
155774
155747
|
groupIndex++;
|
|
155775
155748
|
}
|
|
155776
|
-
if (!
|
|
155777
|
-
|
|
155749
|
+
if (!group2[groupIndex]) {
|
|
155750
|
+
group2[groupIndex] = [];
|
|
155778
155751
|
}
|
|
155779
|
-
|
|
155752
|
+
group2[groupIndex].push(decl);
|
|
155780
155753
|
}
|
|
155781
|
-
return
|
|
155754
|
+
return group2;
|
|
155782
155755
|
}
|
|
155783
|
-
function isNewGroup(sourceFile,
|
|
155784
|
-
const startPos =
|
|
155785
|
-
const endPos =
|
|
155756
|
+
function isNewGroup(sourceFile, decl, scanner2) {
|
|
155757
|
+
const startPos = decl.getFullStart();
|
|
155758
|
+
const endPos = decl.getStart();
|
|
155786
155759
|
scanner2.setText(sourceFile.text, startPos, endPos - startPos);
|
|
155787
155760
|
let numberOfNewLines = 0;
|
|
155788
155761
|
while (scanner2.getTokenPos() < endPos) {
|
|
@@ -156063,7 +156036,7 @@ ${lanes.join("\n")}
|
|
|
156063
156036
|
}
|
|
156064
156037
|
function detectSorting(sourceFile, preferences) {
|
|
156065
156038
|
return detectSortingWorker(
|
|
156066
|
-
|
|
156039
|
+
groupByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration)),
|
|
156067
156040
|
preferences
|
|
156068
156041
|
);
|
|
156069
156042
|
}
|
|
@@ -156230,6 +156203,33 @@ ${lanes.join("\n")}
|
|
|
156230
156203
|
const ignoreCase = typeof preferences.organizeImportsIgnoreCase === "boolean" ? preferences.organizeImportsIgnoreCase : (_a2 = detectIgnoreCase == null ? void 0 : detectIgnoreCase()) != null ? _a2 : false;
|
|
156231
156204
|
return getOrganizeImportsComparer(preferences, ignoreCase);
|
|
156232
156205
|
}
|
|
156206
|
+
function getTopLevelExportGroups(sourceFile) {
|
|
156207
|
+
const topLevelExportGroups = [];
|
|
156208
|
+
const statements = sourceFile.statements;
|
|
156209
|
+
const len = length(statements);
|
|
156210
|
+
let i = 0;
|
|
156211
|
+
let groupIndex = 0;
|
|
156212
|
+
while (i < len) {
|
|
156213
|
+
if (isExportDeclaration(statements[i])) {
|
|
156214
|
+
if (topLevelExportGroups[groupIndex] === void 0) {
|
|
156215
|
+
topLevelExportGroups[groupIndex] = [];
|
|
156216
|
+
}
|
|
156217
|
+
const exportDecl = statements[i];
|
|
156218
|
+
if (exportDecl.moduleSpecifier) {
|
|
156219
|
+
topLevelExportGroups[groupIndex].push(exportDecl);
|
|
156220
|
+
i++;
|
|
156221
|
+
} else {
|
|
156222
|
+
while (i < len && isExportDeclaration(statements[i])) {
|
|
156223
|
+
topLevelExportGroups[groupIndex].push(statements[i++]);
|
|
156224
|
+
}
|
|
156225
|
+
groupIndex++;
|
|
156226
|
+
}
|
|
156227
|
+
} else {
|
|
156228
|
+
i++;
|
|
156229
|
+
}
|
|
156230
|
+
}
|
|
156231
|
+
return flatMap(topLevelExportGroups, (exportGroupDecls) => groupByNewlineContiguous(sourceFile, exportGroupDecls));
|
|
156232
|
+
}
|
|
156233
156233
|
var ImportSpecifierSortingCache, detectImportSpecifierSorting;
|
|
156234
156234
|
var init_organizeImports = __esm({
|
|
156235
156235
|
"src/services/organizeImports.ts"() {
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.1";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20230304`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -2212,41 +2212,8 @@ function tryGetWebPerformanceHooks() {
|
|
|
2212
2212
|
function tryGetNodePerformanceHooks() {
|
|
2213
2213
|
if (isNodeLikeSystem()) {
|
|
2214
2214
|
try {
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
if (hasRequiredAPI(nodePerformance, PerformanceObserver2)) {
|
|
2218
|
-
performance2 = nodePerformance;
|
|
2219
|
-
const version2 = new Version(process.versions.node);
|
|
2220
|
-
const range = new VersionRange("<12.16.3 || 13 <13.13");
|
|
2221
|
-
if (range.test(version2)) {
|
|
2222
|
-
performance2 = {
|
|
2223
|
-
get timeOrigin() {
|
|
2224
|
-
return nodePerformance.timeOrigin;
|
|
2225
|
-
},
|
|
2226
|
-
now() {
|
|
2227
|
-
return nodePerformance.now();
|
|
2228
|
-
},
|
|
2229
|
-
mark(name) {
|
|
2230
|
-
return nodePerformance.mark(name);
|
|
2231
|
-
},
|
|
2232
|
-
measure(name, start = "nodeStart", end) {
|
|
2233
|
-
if (end === void 0) {
|
|
2234
|
-
end = "__performance.measure-fix__";
|
|
2235
|
-
nodePerformance.mark(end);
|
|
2236
|
-
}
|
|
2237
|
-
nodePerformance.measure(name, start, end);
|
|
2238
|
-
if (end === "__performance.measure-fix__") {
|
|
2239
|
-
nodePerformance.clearMarks("__performance.measure-fix__");
|
|
2240
|
-
}
|
|
2241
|
-
},
|
|
2242
|
-
clearMarks(name) {
|
|
2243
|
-
return nodePerformance.clearMarks(name);
|
|
2244
|
-
},
|
|
2245
|
-
clearMeasures(name) {
|
|
2246
|
-
return nodePerformance.clearMeasures(name);
|
|
2247
|
-
}
|
|
2248
|
-
};
|
|
2249
|
-
}
|
|
2215
|
+
const { performance: performance2, PerformanceObserver: PerformanceObserver2 } = require("perf_hooks");
|
|
2216
|
+
if (hasRequiredAPI(performance2, PerformanceObserver2)) {
|
|
2250
2217
|
return {
|
|
2251
2218
|
// By default, only write native events when generating a cpu profile or using the v8 profiler.
|
|
2252
2219
|
shouldWriteNativeEvents: false,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.1.0-pr-
|
|
5
|
+
"version": "5.1.0-pr-53092-8",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|