typescript 5.5.0-dev.20240306 → 5.5.0-dev.20240308
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 +32 -7
- package/lib/tsserver.js +58 -19
- package/lib/typescript.js +58 -19
- package/lib/typingsInstaller.js +2 -1
- package/package.json +18 -19
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.5";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20240308`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -7554,6 +7554,7 @@ var Diagnostics = {
|
|
|
7554
7554
|
Update_import_from_0: diag(90058, 3 /* Message */, "Update_import_from_0_90058", 'Update import from "{0}"'),
|
|
7555
7555
|
Export_0_from_module_1: diag(90059, 3 /* Message */, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"),
|
|
7556
7556
|
Export_all_referenced_locals: diag(90060, 3 /* Message */, "Export_all_referenced_locals_90060", "Export all referenced locals"),
|
|
7557
|
+
Update_modifiers_of_0: diag(90061, 3 /* Message */, "Update_modifiers_of_0_90061", "Update modifiers of '{0}'"),
|
|
7557
7558
|
Convert_function_to_an_ES2015_class: diag(95001, 3 /* Message */, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
|
|
7558
7559
|
Convert_0_to_1_in_0: diag(95003, 3 /* Message */, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
|
|
7559
7560
|
Extract_to_0_in_1: diag(95004, 3 /* Message */, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
|
|
@@ -86814,6 +86815,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
86814
86815
|
const exportedBindings = [];
|
|
86815
86816
|
const uniqueExports = /* @__PURE__ */ new Map();
|
|
86816
86817
|
let exportedNames;
|
|
86818
|
+
let exportedFunctions;
|
|
86817
86819
|
let hasExportDefault = false;
|
|
86818
86820
|
let exportEquals;
|
|
86819
86821
|
let hasExportStarsToExportValues = false;
|
|
@@ -86872,6 +86874,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
86872
86874
|
break;
|
|
86873
86875
|
case 262 /* FunctionDeclaration */:
|
|
86874
86876
|
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
86877
|
+
exportedFunctions = append(exportedFunctions, node);
|
|
86875
86878
|
if (hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
86876
86879
|
if (!hasExportDefault) {
|
|
86877
86880
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node));
|
|
@@ -86882,7 +86885,6 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
86882
86885
|
if (!uniqueExports.get(idText(name))) {
|
|
86883
86886
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
|
|
86884
86887
|
uniqueExports.set(idText(name), true);
|
|
86885
|
-
exportedNames = append(exportedNames, name);
|
|
86886
86888
|
}
|
|
86887
86889
|
}
|
|
86888
86890
|
}
|
|
@@ -86910,7 +86912,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
86910
86912
|
if (externalHelpersImportDeclaration) {
|
|
86911
86913
|
externalImports.unshift(externalHelpersImportDeclaration);
|
|
86912
86914
|
}
|
|
86913
|
-
return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, externalHelpersImportDeclaration };
|
|
86915
|
+
return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, exportedFunctions, externalHelpersImportDeclaration };
|
|
86914
86916
|
function addExportedNamesForExportDeclaration(node) {
|
|
86915
86917
|
for (const specifier of cast(node.exportClause, isNamedExports).elements) {
|
|
86916
86918
|
if (!uniqueExports.get(idText(specifier.name))) {
|
|
@@ -104241,7 +104243,7 @@ function transformModule(context) {
|
|
|
104241
104243
|
if (shouldEmitUnderscoreUnderscoreESModule()) {
|
|
104242
104244
|
append(statements, createUnderscoreUnderscoreESModule());
|
|
104243
104245
|
}
|
|
104244
|
-
if (
|
|
104246
|
+
if (some(currentModuleInfo.exportedNames)) {
|
|
104245
104247
|
const chunkSize = 50;
|
|
104246
104248
|
for (let i = 0; i < currentModuleInfo.exportedNames.length; i += chunkSize) {
|
|
104247
104249
|
append(
|
|
@@ -104256,6 +104258,11 @@ function transformModule(context) {
|
|
|
104256
104258
|
);
|
|
104257
104259
|
}
|
|
104258
104260
|
}
|
|
104261
|
+
if (some(currentModuleInfo.exportedFunctions)) {
|
|
104262
|
+
for (const f of currentModuleInfo.exportedFunctions) {
|
|
104263
|
+
appendExportsOfHoistedDeclaration(statements, f);
|
|
104264
|
+
}
|
|
104265
|
+
}
|
|
104259
104266
|
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
|
|
104260
104267
|
addRange(statements, visitNodes2(node.statements, topLevelVisitor, isStatement, statementOffset));
|
|
104261
104268
|
addExportEqualsIfNeeded(
|
|
@@ -104568,9 +104575,14 @@ function transformModule(context) {
|
|
|
104568
104575
|
if (shouldEmitUnderscoreUnderscoreESModule()) {
|
|
104569
104576
|
append(statements, createUnderscoreUnderscoreESModule());
|
|
104570
104577
|
}
|
|
104571
|
-
if (
|
|
104578
|
+
if (some(currentModuleInfo.exportedNames)) {
|
|
104572
104579
|
append(statements, factory2.createExpressionStatement(reduceLeft(currentModuleInfo.exportedNames, (prev, nextId) => factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev), factory2.createVoidZero())));
|
|
104573
104580
|
}
|
|
104581
|
+
if (some(currentModuleInfo.exportedFunctions)) {
|
|
104582
|
+
for (const f of currentModuleInfo.exportedFunctions) {
|
|
104583
|
+
appendExportsOfHoistedDeclaration(statements, f);
|
|
104584
|
+
}
|
|
104585
|
+
}
|
|
104574
104586
|
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
|
|
104575
104587
|
if (moduleKind === 2 /* AMD */) {
|
|
104576
104588
|
addRange(statements, mapDefined(currentModuleInfo.externalImports, getAMDImportExpressionForImport));
|
|
@@ -105541,7 +105553,6 @@ function transformModule(context) {
|
|
|
105541
105553
|
} else {
|
|
105542
105554
|
statements = append(statements, visitEachChild(node, visitor, context));
|
|
105543
105555
|
}
|
|
105544
|
-
statements = appendExportsOfHoistedDeclaration(statements, node);
|
|
105545
105556
|
return singleOrMany(statements);
|
|
105546
105557
|
}
|
|
105547
105558
|
function visitClassDeclaration(node) {
|
|
@@ -106284,7 +106295,7 @@ function transformSystemModule(context) {
|
|
|
106284
106295
|
if (!moduleInfo.hasExportStarsToExportValues) {
|
|
106285
106296
|
return;
|
|
106286
106297
|
}
|
|
106287
|
-
if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) {
|
|
106298
|
+
if (!some(moduleInfo.exportedNames) && !some(moduleInfo.exportedFunctions) && moduleInfo.exportSpecifiers.size === 0) {
|
|
106288
106299
|
let hasExportDeclarationWithExportClause = false;
|
|
106289
106300
|
for (const externalImport of moduleInfo.externalImports) {
|
|
106290
106301
|
if (externalImport.kind === 278 /* ExportDeclaration */ && externalImport.exportClause) {
|
|
@@ -106315,6 +106326,20 @@ function transformSystemModule(context) {
|
|
|
106315
106326
|
);
|
|
106316
106327
|
}
|
|
106317
106328
|
}
|
|
106329
|
+
if (moduleInfo.exportedFunctions) {
|
|
106330
|
+
for (const f of moduleInfo.exportedFunctions) {
|
|
106331
|
+
if (hasSyntacticModifier(f, 2048 /* Default */)) {
|
|
106332
|
+
continue;
|
|
106333
|
+
}
|
|
106334
|
+
Debug.assert(!!f.name);
|
|
106335
|
+
exportedNames.push(
|
|
106336
|
+
factory2.createPropertyAssignment(
|
|
106337
|
+
factory2.createStringLiteralFromNode(f.name),
|
|
106338
|
+
factory2.createTrue()
|
|
106339
|
+
)
|
|
106340
|
+
);
|
|
106341
|
+
}
|
|
106342
|
+
}
|
|
106318
106343
|
const exportedNamesStorageRef = factory2.createUniqueName("exportedNames");
|
|
106319
106344
|
statements.push(
|
|
106320
106345
|
factory2.createVariableStatement(
|
package/lib/tsserver.js
CHANGED
|
@@ -2325,7 +2325,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2325
2325
|
|
|
2326
2326
|
// src/compiler/corePublic.ts
|
|
2327
2327
|
var versionMajorMinor = "5.5";
|
|
2328
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2328
|
+
var version = `${versionMajorMinor}.0-dev.20240308`;
|
|
2329
2329
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2330
2330
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2331
2331
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -11100,6 +11100,7 @@ var Diagnostics = {
|
|
|
11100
11100
|
Update_import_from_0: diag(90058, 3 /* Message */, "Update_import_from_0_90058", 'Update import from "{0}"'),
|
|
11101
11101
|
Export_0_from_module_1: diag(90059, 3 /* Message */, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"),
|
|
11102
11102
|
Export_all_referenced_locals: diag(90060, 3 /* Message */, "Export_all_referenced_locals_90060", "Export all referenced locals"),
|
|
11103
|
+
Update_modifiers_of_0: diag(90061, 3 /* Message */, "Update_modifiers_of_0_90061", "Update modifiers of '{0}'"),
|
|
11103
11104
|
Convert_function_to_an_ES2015_class: diag(95001, 3 /* Message */, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
|
|
11104
11105
|
Convert_0_to_1_in_0: diag(95003, 3 /* Message */, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
|
|
11105
11106
|
Extract_to_0_in_1: diag(95004, 3 /* Message */, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
|
|
@@ -91710,6 +91711,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
91710
91711
|
const exportedBindings = [];
|
|
91711
91712
|
const uniqueExports = /* @__PURE__ */ new Map();
|
|
91712
91713
|
let exportedNames;
|
|
91714
|
+
let exportedFunctions;
|
|
91713
91715
|
let hasExportDefault = false;
|
|
91714
91716
|
let exportEquals;
|
|
91715
91717
|
let hasExportStarsToExportValues = false;
|
|
@@ -91768,6 +91770,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
91768
91770
|
break;
|
|
91769
91771
|
case 262 /* FunctionDeclaration */:
|
|
91770
91772
|
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
91773
|
+
exportedFunctions = append(exportedFunctions, node);
|
|
91771
91774
|
if (hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
91772
91775
|
if (!hasExportDefault) {
|
|
91773
91776
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node));
|
|
@@ -91778,7 +91781,6 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
91778
91781
|
if (!uniqueExports.get(idText(name))) {
|
|
91779
91782
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
|
|
91780
91783
|
uniqueExports.set(idText(name), true);
|
|
91781
|
-
exportedNames = append(exportedNames, name);
|
|
91782
91784
|
}
|
|
91783
91785
|
}
|
|
91784
91786
|
}
|
|
@@ -91806,7 +91808,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
91806
91808
|
if (externalHelpersImportDeclaration) {
|
|
91807
91809
|
externalImports.unshift(externalHelpersImportDeclaration);
|
|
91808
91810
|
}
|
|
91809
|
-
return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, externalHelpersImportDeclaration };
|
|
91811
|
+
return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, exportedFunctions, externalHelpersImportDeclaration };
|
|
91810
91812
|
function addExportedNamesForExportDeclaration(node) {
|
|
91811
91813
|
for (const specifier of cast(node.exportClause, isNamedExports).elements) {
|
|
91812
91814
|
if (!uniqueExports.get(idText(specifier.name))) {
|
|
@@ -109147,7 +109149,7 @@ function transformModule(context) {
|
|
|
109147
109149
|
if (shouldEmitUnderscoreUnderscoreESModule()) {
|
|
109148
109150
|
append(statements, createUnderscoreUnderscoreESModule());
|
|
109149
109151
|
}
|
|
109150
|
-
if (
|
|
109152
|
+
if (some(currentModuleInfo.exportedNames)) {
|
|
109151
109153
|
const chunkSize = 50;
|
|
109152
109154
|
for (let i = 0; i < currentModuleInfo.exportedNames.length; i += chunkSize) {
|
|
109153
109155
|
append(
|
|
@@ -109162,6 +109164,11 @@ function transformModule(context) {
|
|
|
109162
109164
|
);
|
|
109163
109165
|
}
|
|
109164
109166
|
}
|
|
109167
|
+
if (some(currentModuleInfo.exportedFunctions)) {
|
|
109168
|
+
for (const f of currentModuleInfo.exportedFunctions) {
|
|
109169
|
+
appendExportsOfHoistedDeclaration(statements, f);
|
|
109170
|
+
}
|
|
109171
|
+
}
|
|
109165
109172
|
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
|
|
109166
109173
|
addRange(statements, visitNodes2(node.statements, topLevelVisitor, isStatement, statementOffset));
|
|
109167
109174
|
addExportEqualsIfNeeded(
|
|
@@ -109474,9 +109481,14 @@ function transformModule(context) {
|
|
|
109474
109481
|
if (shouldEmitUnderscoreUnderscoreESModule()) {
|
|
109475
109482
|
append(statements, createUnderscoreUnderscoreESModule());
|
|
109476
109483
|
}
|
|
109477
|
-
if (
|
|
109484
|
+
if (some(currentModuleInfo.exportedNames)) {
|
|
109478
109485
|
append(statements, factory2.createExpressionStatement(reduceLeft(currentModuleInfo.exportedNames, (prev, nextId) => factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev), factory2.createVoidZero())));
|
|
109479
109486
|
}
|
|
109487
|
+
if (some(currentModuleInfo.exportedFunctions)) {
|
|
109488
|
+
for (const f of currentModuleInfo.exportedFunctions) {
|
|
109489
|
+
appendExportsOfHoistedDeclaration(statements, f);
|
|
109490
|
+
}
|
|
109491
|
+
}
|
|
109480
109492
|
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
|
|
109481
109493
|
if (moduleKind === 2 /* AMD */) {
|
|
109482
109494
|
addRange(statements, mapDefined(currentModuleInfo.externalImports, getAMDImportExpressionForImport));
|
|
@@ -110447,7 +110459,6 @@ function transformModule(context) {
|
|
|
110447
110459
|
} else {
|
|
110448
110460
|
statements = append(statements, visitEachChild(node, visitor, context));
|
|
110449
110461
|
}
|
|
110450
|
-
statements = appendExportsOfHoistedDeclaration(statements, node);
|
|
110451
110462
|
return singleOrMany(statements);
|
|
110452
110463
|
}
|
|
110453
110464
|
function visitClassDeclaration(node) {
|
|
@@ -111190,7 +111201,7 @@ function transformSystemModule(context) {
|
|
|
111190
111201
|
if (!moduleInfo.hasExportStarsToExportValues) {
|
|
111191
111202
|
return;
|
|
111192
111203
|
}
|
|
111193
|
-
if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) {
|
|
111204
|
+
if (!some(moduleInfo.exportedNames) && !some(moduleInfo.exportedFunctions) && moduleInfo.exportSpecifiers.size === 0) {
|
|
111194
111205
|
let hasExportDeclarationWithExportClause = false;
|
|
111195
111206
|
for (const externalImport of moduleInfo.externalImports) {
|
|
111196
111207
|
if (externalImport.kind === 278 /* ExportDeclaration */ && externalImport.exportClause) {
|
|
@@ -111221,6 +111232,20 @@ function transformSystemModule(context) {
|
|
|
111221
111232
|
);
|
|
111222
111233
|
}
|
|
111223
111234
|
}
|
|
111235
|
+
if (moduleInfo.exportedFunctions) {
|
|
111236
|
+
for (const f of moduleInfo.exportedFunctions) {
|
|
111237
|
+
if (hasSyntacticModifier(f, 2048 /* Default */)) {
|
|
111238
|
+
continue;
|
|
111239
|
+
}
|
|
111240
|
+
Debug.assert(!!f.name);
|
|
111241
|
+
exportedNames.push(
|
|
111242
|
+
factory2.createPropertyAssignment(
|
|
111243
|
+
factory2.createStringLiteralFromNode(f.name),
|
|
111244
|
+
factory2.createTrue()
|
|
111245
|
+
)
|
|
111246
|
+
);
|
|
111247
|
+
}
|
|
111248
|
+
}
|
|
111224
111249
|
const exportedNamesStorageRef = factory2.createUniqueName("exportedNames");
|
|
111225
111250
|
statements.push(
|
|
111226
111251
|
factory2.createVariableStatement(
|
|
@@ -158480,10 +158505,21 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
158480
158505
|
}
|
|
158481
158506
|
if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
158482
158507
|
let importAdder;
|
|
158483
|
-
const memberCompletionEntry = getEntryForMemberCompletion(
|
|
158508
|
+
const memberCompletionEntry = getEntryForMemberCompletion(
|
|
158509
|
+
host,
|
|
158510
|
+
program,
|
|
158511
|
+
options,
|
|
158512
|
+
preferences,
|
|
158513
|
+
name,
|
|
158514
|
+
symbol,
|
|
158515
|
+
location,
|
|
158516
|
+
position,
|
|
158517
|
+
contextToken,
|
|
158518
|
+
formatContext
|
|
158519
|
+
);
|
|
158484
158520
|
if (memberCompletionEntry) {
|
|
158485
158521
|
({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
|
|
158486
|
-
if (importAdder == null ? void 0 : importAdder.hasFixes()) {
|
|
158522
|
+
if ((importAdder == null ? void 0 : importAdder.hasFixes()) || memberCompletionEntry.eraseRange) {
|
|
158487
158523
|
hasAction = true;
|
|
158488
158524
|
source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
|
|
158489
158525
|
}
|
|
@@ -158680,19 +158716,22 @@ function getPresentModifiers(contextToken, sourceFile, position) {
|
|
|
158680
158716
|
let decorators;
|
|
158681
158717
|
let contextMod;
|
|
158682
158718
|
const range = { pos: position, end: position };
|
|
158683
|
-
if (isPropertyDeclaration(contextToken.parent) && contextToken
|
|
158684
|
-
|
|
158685
|
-
|
|
158686
|
-
|
|
158687
|
-
|
|
158688
|
-
|
|
158719
|
+
if (isPropertyDeclaration(contextToken.parent) && (contextMod = isModifierLike2(contextToken))) {
|
|
158720
|
+
if (contextToken.parent.modifiers) {
|
|
158721
|
+
modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 98303 /* Modifier */;
|
|
158722
|
+
decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
|
|
158723
|
+
range.pos = Math.min(...contextToken.parent.modifiers.map((n) => n.getStart(sourceFile)));
|
|
158724
|
+
}
|
|
158689
158725
|
const contextModifierFlag = modifierToFlag(contextMod);
|
|
158690
158726
|
if (!(modifiers & contextModifierFlag)) {
|
|
158691
158727
|
modifiers |= contextModifierFlag;
|
|
158692
|
-
range.pos = Math.min(range.pos, contextToken.
|
|
158728
|
+
range.pos = Math.min(range.pos, contextToken.getStart(sourceFile));
|
|
158729
|
+
}
|
|
158730
|
+
if (contextToken.parent.name !== contextToken) {
|
|
158731
|
+
range.end = contextToken.parent.name.getStart(sourceFile);
|
|
158693
158732
|
}
|
|
158694
158733
|
}
|
|
158695
|
-
return { modifiers, decorators, range: range.pos
|
|
158734
|
+
return { modifiers, decorators, range: range.pos < range.end ? range : void 0 };
|
|
158696
158735
|
}
|
|
158697
158736
|
function isModifierLike2(node) {
|
|
158698
158737
|
if (isModifier(node)) {
|
|
@@ -159334,7 +159373,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
|
|
|
159334
159373
|
contextToken,
|
|
159335
159374
|
formatContext
|
|
159336
159375
|
);
|
|
159337
|
-
if (importAdder || eraseRange) {
|
|
159376
|
+
if ((importAdder == null ? void 0 : importAdder.hasFixes()) || eraseRange) {
|
|
159338
159377
|
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
159339
159378
|
{ host, formatContext, preferences },
|
|
159340
159379
|
(tracker) => {
|
|
@@ -159350,7 +159389,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
|
|
|
159350
159389
|
sourceDisplay: void 0,
|
|
159351
159390
|
codeActions: [{
|
|
159352
159391
|
changes,
|
|
159353
|
-
description: diagnosticToString([Diagnostics.Includes_imports_of_types_referenced_by_0, name])
|
|
159392
|
+
description: (importAdder == null ? void 0 : importAdder.hasFixes()) ? diagnosticToString([Diagnostics.Includes_imports_of_types_referenced_by_0, name]) : diagnosticToString([Diagnostics.Update_modifiers_of_0, name])
|
|
159354
159393
|
}]
|
|
159355
159394
|
};
|
|
159356
159395
|
}
|
package/lib/typescript.js
CHANGED
|
@@ -2325,7 +2325,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2325
2325
|
|
|
2326
2326
|
// src/compiler/corePublic.ts
|
|
2327
2327
|
var versionMajorMinor = "5.5";
|
|
2328
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2328
|
+
var version = `${versionMajorMinor}.0-dev.20240308`;
|
|
2329
2329
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2330
2330
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2331
2331
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -11100,6 +11100,7 @@ var Diagnostics = {
|
|
|
11100
11100
|
Update_import_from_0: diag(90058, 3 /* Message */, "Update_import_from_0_90058", 'Update import from "{0}"'),
|
|
11101
11101
|
Export_0_from_module_1: diag(90059, 3 /* Message */, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"),
|
|
11102
11102
|
Export_all_referenced_locals: diag(90060, 3 /* Message */, "Export_all_referenced_locals_90060", "Export all referenced locals"),
|
|
11103
|
+
Update_modifiers_of_0: diag(90061, 3 /* Message */, "Update_modifiers_of_0_90061", "Update modifiers of '{0}'"),
|
|
11103
11104
|
Convert_function_to_an_ES2015_class: diag(95001, 3 /* Message */, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
|
|
11104
11105
|
Convert_0_to_1_in_0: diag(95003, 3 /* Message */, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
|
|
11105
11106
|
Extract_to_0_in_1: diag(95004, 3 /* Message */, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
|
|
@@ -91710,6 +91711,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
91710
91711
|
const exportedBindings = [];
|
|
91711
91712
|
const uniqueExports = /* @__PURE__ */ new Map();
|
|
91712
91713
|
let exportedNames;
|
|
91714
|
+
let exportedFunctions;
|
|
91713
91715
|
let hasExportDefault = false;
|
|
91714
91716
|
let exportEquals;
|
|
91715
91717
|
let hasExportStarsToExportValues = false;
|
|
@@ -91768,6 +91770,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
91768
91770
|
break;
|
|
91769
91771
|
case 262 /* FunctionDeclaration */:
|
|
91770
91772
|
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
91773
|
+
exportedFunctions = append(exportedFunctions, node);
|
|
91771
91774
|
if (hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
91772
91775
|
if (!hasExportDefault) {
|
|
91773
91776
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node));
|
|
@@ -91778,7 +91781,6 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
91778
91781
|
if (!uniqueExports.get(idText(name))) {
|
|
91779
91782
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
|
|
91780
91783
|
uniqueExports.set(idText(name), true);
|
|
91781
|
-
exportedNames = append(exportedNames, name);
|
|
91782
91784
|
}
|
|
91783
91785
|
}
|
|
91784
91786
|
}
|
|
@@ -91806,7 +91808,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
91806
91808
|
if (externalHelpersImportDeclaration) {
|
|
91807
91809
|
externalImports.unshift(externalHelpersImportDeclaration);
|
|
91808
91810
|
}
|
|
91809
|
-
return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, externalHelpersImportDeclaration };
|
|
91811
|
+
return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, exportedFunctions, externalHelpersImportDeclaration };
|
|
91810
91812
|
function addExportedNamesForExportDeclaration(node) {
|
|
91811
91813
|
for (const specifier of cast(node.exportClause, isNamedExports).elements) {
|
|
91812
91814
|
if (!uniqueExports.get(idText(specifier.name))) {
|
|
@@ -109147,7 +109149,7 @@ function transformModule(context) {
|
|
|
109147
109149
|
if (shouldEmitUnderscoreUnderscoreESModule()) {
|
|
109148
109150
|
append(statements, createUnderscoreUnderscoreESModule());
|
|
109149
109151
|
}
|
|
109150
|
-
if (
|
|
109152
|
+
if (some(currentModuleInfo.exportedNames)) {
|
|
109151
109153
|
const chunkSize = 50;
|
|
109152
109154
|
for (let i = 0; i < currentModuleInfo.exportedNames.length; i += chunkSize) {
|
|
109153
109155
|
append(
|
|
@@ -109162,6 +109164,11 @@ function transformModule(context) {
|
|
|
109162
109164
|
);
|
|
109163
109165
|
}
|
|
109164
109166
|
}
|
|
109167
|
+
if (some(currentModuleInfo.exportedFunctions)) {
|
|
109168
|
+
for (const f of currentModuleInfo.exportedFunctions) {
|
|
109169
|
+
appendExportsOfHoistedDeclaration(statements, f);
|
|
109170
|
+
}
|
|
109171
|
+
}
|
|
109165
109172
|
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
|
|
109166
109173
|
addRange(statements, visitNodes2(node.statements, topLevelVisitor, isStatement, statementOffset));
|
|
109167
109174
|
addExportEqualsIfNeeded(
|
|
@@ -109474,9 +109481,14 @@ function transformModule(context) {
|
|
|
109474
109481
|
if (shouldEmitUnderscoreUnderscoreESModule()) {
|
|
109475
109482
|
append(statements, createUnderscoreUnderscoreESModule());
|
|
109476
109483
|
}
|
|
109477
|
-
if (
|
|
109484
|
+
if (some(currentModuleInfo.exportedNames)) {
|
|
109478
109485
|
append(statements, factory2.createExpressionStatement(reduceLeft(currentModuleInfo.exportedNames, (prev, nextId) => factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev), factory2.createVoidZero())));
|
|
109479
109486
|
}
|
|
109487
|
+
if (some(currentModuleInfo.exportedFunctions)) {
|
|
109488
|
+
for (const f of currentModuleInfo.exportedFunctions) {
|
|
109489
|
+
appendExportsOfHoistedDeclaration(statements, f);
|
|
109490
|
+
}
|
|
109491
|
+
}
|
|
109480
109492
|
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
|
|
109481
109493
|
if (moduleKind === 2 /* AMD */) {
|
|
109482
109494
|
addRange(statements, mapDefined(currentModuleInfo.externalImports, getAMDImportExpressionForImport));
|
|
@@ -110447,7 +110459,6 @@ function transformModule(context) {
|
|
|
110447
110459
|
} else {
|
|
110448
110460
|
statements = append(statements, visitEachChild(node, visitor, context));
|
|
110449
110461
|
}
|
|
110450
|
-
statements = appendExportsOfHoistedDeclaration(statements, node);
|
|
110451
110462
|
return singleOrMany(statements);
|
|
110452
110463
|
}
|
|
110453
110464
|
function visitClassDeclaration(node) {
|
|
@@ -111190,7 +111201,7 @@ function transformSystemModule(context) {
|
|
|
111190
111201
|
if (!moduleInfo.hasExportStarsToExportValues) {
|
|
111191
111202
|
return;
|
|
111192
111203
|
}
|
|
111193
|
-
if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) {
|
|
111204
|
+
if (!some(moduleInfo.exportedNames) && !some(moduleInfo.exportedFunctions) && moduleInfo.exportSpecifiers.size === 0) {
|
|
111194
111205
|
let hasExportDeclarationWithExportClause = false;
|
|
111195
111206
|
for (const externalImport of moduleInfo.externalImports) {
|
|
111196
111207
|
if (externalImport.kind === 278 /* ExportDeclaration */ && externalImport.exportClause) {
|
|
@@ -111221,6 +111232,20 @@ function transformSystemModule(context) {
|
|
|
111221
111232
|
);
|
|
111222
111233
|
}
|
|
111223
111234
|
}
|
|
111235
|
+
if (moduleInfo.exportedFunctions) {
|
|
111236
|
+
for (const f of moduleInfo.exportedFunctions) {
|
|
111237
|
+
if (hasSyntacticModifier(f, 2048 /* Default */)) {
|
|
111238
|
+
continue;
|
|
111239
|
+
}
|
|
111240
|
+
Debug.assert(!!f.name);
|
|
111241
|
+
exportedNames.push(
|
|
111242
|
+
factory2.createPropertyAssignment(
|
|
111243
|
+
factory2.createStringLiteralFromNode(f.name),
|
|
111244
|
+
factory2.createTrue()
|
|
111245
|
+
)
|
|
111246
|
+
);
|
|
111247
|
+
}
|
|
111248
|
+
}
|
|
111224
111249
|
const exportedNamesStorageRef = factory2.createUniqueName("exportedNames");
|
|
111225
111250
|
statements.push(
|
|
111226
111251
|
factory2.createVariableStatement(
|
|
@@ -158480,10 +158505,21 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
158480
158505
|
}
|
|
158481
158506
|
if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
158482
158507
|
let importAdder;
|
|
158483
|
-
const memberCompletionEntry = getEntryForMemberCompletion(
|
|
158508
|
+
const memberCompletionEntry = getEntryForMemberCompletion(
|
|
158509
|
+
host,
|
|
158510
|
+
program,
|
|
158511
|
+
options,
|
|
158512
|
+
preferences,
|
|
158513
|
+
name,
|
|
158514
|
+
symbol,
|
|
158515
|
+
location,
|
|
158516
|
+
position,
|
|
158517
|
+
contextToken,
|
|
158518
|
+
formatContext
|
|
158519
|
+
);
|
|
158484
158520
|
if (memberCompletionEntry) {
|
|
158485
158521
|
({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
|
|
158486
|
-
if (importAdder == null ? void 0 : importAdder.hasFixes()) {
|
|
158522
|
+
if ((importAdder == null ? void 0 : importAdder.hasFixes()) || memberCompletionEntry.eraseRange) {
|
|
158487
158523
|
hasAction = true;
|
|
158488
158524
|
source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
|
|
158489
158525
|
}
|
|
@@ -158680,19 +158716,22 @@ function getPresentModifiers(contextToken, sourceFile, position) {
|
|
|
158680
158716
|
let decorators;
|
|
158681
158717
|
let contextMod;
|
|
158682
158718
|
const range = { pos: position, end: position };
|
|
158683
|
-
if (isPropertyDeclaration(contextToken.parent) && contextToken
|
|
158684
|
-
|
|
158685
|
-
|
|
158686
|
-
|
|
158687
|
-
|
|
158688
|
-
|
|
158719
|
+
if (isPropertyDeclaration(contextToken.parent) && (contextMod = isModifierLike2(contextToken))) {
|
|
158720
|
+
if (contextToken.parent.modifiers) {
|
|
158721
|
+
modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 98303 /* Modifier */;
|
|
158722
|
+
decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
|
|
158723
|
+
range.pos = Math.min(...contextToken.parent.modifiers.map((n) => n.getStart(sourceFile)));
|
|
158724
|
+
}
|
|
158689
158725
|
const contextModifierFlag = modifierToFlag(contextMod);
|
|
158690
158726
|
if (!(modifiers & contextModifierFlag)) {
|
|
158691
158727
|
modifiers |= contextModifierFlag;
|
|
158692
|
-
range.pos = Math.min(range.pos, contextToken.
|
|
158728
|
+
range.pos = Math.min(range.pos, contextToken.getStart(sourceFile));
|
|
158729
|
+
}
|
|
158730
|
+
if (contextToken.parent.name !== contextToken) {
|
|
158731
|
+
range.end = contextToken.parent.name.getStart(sourceFile);
|
|
158693
158732
|
}
|
|
158694
158733
|
}
|
|
158695
|
-
return { modifiers, decorators, range: range.pos
|
|
158734
|
+
return { modifiers, decorators, range: range.pos < range.end ? range : void 0 };
|
|
158696
158735
|
}
|
|
158697
158736
|
function isModifierLike2(node) {
|
|
158698
158737
|
if (isModifier(node)) {
|
|
@@ -159334,7 +159373,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
|
|
|
159334
159373
|
contextToken,
|
|
159335
159374
|
formatContext
|
|
159336
159375
|
);
|
|
159337
|
-
if (importAdder || eraseRange) {
|
|
159376
|
+
if ((importAdder == null ? void 0 : importAdder.hasFixes()) || eraseRange) {
|
|
159338
159377
|
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
159339
159378
|
{ host, formatContext, preferences },
|
|
159340
159379
|
(tracker) => {
|
|
@@ -159350,7 +159389,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
|
|
|
159350
159389
|
sourceDisplay: void 0,
|
|
159351
159390
|
codeActions: [{
|
|
159352
159391
|
changes,
|
|
159353
|
-
description: diagnosticToString([Diagnostics.Includes_imports_of_types_referenced_by_0, name])
|
|
159392
|
+
description: (importAdder == null ? void 0 : importAdder.hasFixes()) ? diagnosticToString([Diagnostics.Includes_imports_of_types_referenced_by_0, name]) : diagnosticToString([Diagnostics.Update_modifiers_of_0, name])
|
|
159354
159393
|
}]
|
|
159355
159394
|
};
|
|
159356
159395
|
}
|
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.5";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20240308`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -6939,6 +6939,7 @@ var Diagnostics = {
|
|
|
6939
6939
|
Update_import_from_0: diag(90058, 3 /* Message */, "Update_import_from_0_90058", 'Update import from "{0}"'),
|
|
6940
6940
|
Export_0_from_module_1: diag(90059, 3 /* Message */, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"),
|
|
6941
6941
|
Export_all_referenced_locals: diag(90060, 3 /* Message */, "Export_all_referenced_locals_90060", "Export all referenced locals"),
|
|
6942
|
+
Update_modifiers_of_0: diag(90061, 3 /* Message */, "Update_modifiers_of_0_90061", "Update modifiers of '{0}'"),
|
|
6942
6943
|
Convert_function_to_an_ES2015_class: diag(95001, 3 /* Message */, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
|
|
6943
6944
|
Convert_0_to_1_in_0: diag(95003, 3 /* Message */, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
|
|
6944
6945
|
Extract_to_0_in_1: diag(95004, 3 /* Message */, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
|
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": "5.5.0-dev.
|
|
5
|
+
"version": "5.5.0-dev.20240308",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -41,8 +41,7 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@esfx/canceltoken": "^1.0.0",
|
|
43
43
|
"@octokit/rest": "^20.0.2",
|
|
44
|
-
"@types/chai": "^4.3.
|
|
45
|
-
"@types/glob": "^8.1.0",
|
|
44
|
+
"@types/chai": "^4.3.12",
|
|
46
45
|
"@types/microsoft__typescript-etw": "^0.1.3",
|
|
47
46
|
"@types/minimist": "^1.2.5",
|
|
48
47
|
"@types/mocha": "^10.0.6",
|
|
@@ -50,35 +49,35 @@
|
|
|
50
49
|
"@types/node": "latest",
|
|
51
50
|
"@types/source-map-support": "^0.5.10",
|
|
52
51
|
"@types/which": "^3.0.3",
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
54
|
-
"@typescript-eslint/parser": "^
|
|
55
|
-
"@typescript-eslint/utils": "^
|
|
56
|
-
"azure-devops-node-api": "^12.
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "^7.1.1",
|
|
53
|
+
"@typescript-eslint/parser": "^7.1.1",
|
|
54
|
+
"@typescript-eslint/utils": "^7.1.1",
|
|
55
|
+
"azure-devops-node-api": "^12.4.0",
|
|
57
56
|
"c8": "^9.1.0",
|
|
58
57
|
"chai": "^4.4.1",
|
|
59
58
|
"chalk": "^4.1.2",
|
|
60
|
-
"chokidar": "^3.
|
|
61
|
-
"diff": "^5.
|
|
59
|
+
"chokidar": "^3.6.0",
|
|
60
|
+
"diff": "^5.2.0",
|
|
62
61
|
"dprint": "^0.45.0",
|
|
63
|
-
"esbuild": "^0.20.
|
|
64
|
-
"eslint": "^8.
|
|
62
|
+
"esbuild": "^0.20.1",
|
|
63
|
+
"eslint": "^8.57.0",
|
|
65
64
|
"eslint-formatter-autolinkable-stylish": "^1.3.0",
|
|
66
|
-
"eslint-plugin-local": "^
|
|
65
|
+
"eslint-plugin-local": "^4.2.1",
|
|
67
66
|
"eslint-plugin-no-null": "^1.0.2",
|
|
68
|
-
"eslint-plugin-simple-import-sort": "^
|
|
69
|
-
"fast-xml-parser": "^4.3.
|
|
67
|
+
"eslint-plugin-simple-import-sort": "^12.0.0",
|
|
68
|
+
"fast-xml-parser": "^4.3.5",
|
|
70
69
|
"glob": "^10.3.10",
|
|
71
70
|
"hereby": "^1.8.9",
|
|
72
|
-
"jsonc-parser": "^3.2.
|
|
71
|
+
"jsonc-parser": "^3.2.1",
|
|
73
72
|
"minimist": "^1.2.8",
|
|
74
|
-
"mocha": "^10.
|
|
73
|
+
"mocha": "^10.3.0",
|
|
75
74
|
"mocha-fivemat-progress-reporter": "^0.1.0",
|
|
76
75
|
"ms": "^2.1.3",
|
|
77
76
|
"node-fetch": "^3.3.2",
|
|
78
|
-
"playwright": "^1.
|
|
77
|
+
"playwright": "^1.42.1",
|
|
79
78
|
"source-map-support": "^0.5.21",
|
|
80
79
|
"tslib": "^2.6.2",
|
|
81
|
-
"typescript": "5.4.
|
|
80
|
+
"typescript": "^5.4.2",
|
|
82
81
|
"which": "^3.0.1"
|
|
83
82
|
},
|
|
84
83
|
"overrides": {
|
|
@@ -113,5 +112,5 @@
|
|
|
113
112
|
"node": "20.1.0",
|
|
114
113
|
"npm": "8.19.4"
|
|
115
114
|
},
|
|
116
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "ddc417bf3c05c86dfa939601700c018acc18ce14"
|
|
117
116
|
}
|