typescript 5.2.0-dev.20230518 → 5.2.0-dev.20230520
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 +14 -16
- package/lib/tsserver.js +22 -19
- package/lib/tsserverlibrary.d.ts +2 -0
- package/lib/tsserverlibrary.js +22 -19
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +20 -18
- package/lib/typingsInstaller.js +2 -1
- package/package.json +2 -2
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.2";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20230520`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -7704,6 +7704,7 @@ var Diagnostics = {
|
|
|
7704
7704
|
Convert_typedef_to_TypeScript_type: diag(95176, 3 /* Message */, "Convert_typedef_to_TypeScript_type_95176", "Convert typedef to TypeScript type."),
|
|
7705
7705
|
Convert_all_typedef_to_TypeScript_types: diag(95177, 3 /* Message */, "Convert_all_typedef_to_TypeScript_types_95177", "Convert all typedef to TypeScript types."),
|
|
7706
7706
|
Move_to_file: diag(95178, 3 /* Message */, "Move_to_file_95178", "Move to file"),
|
|
7707
|
+
Cannot_move_to_file_selected_file_is_invalid: diag(95179, 3 /* Message */, "Cannot_move_to_file_selected_file_is_invalid_95179", "Cannot move to file, selected file is invalid"),
|
|
7707
7708
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
7708
7709
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
7709
7710
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
|
@@ -56215,31 +56216,28 @@ function createTypeChecker(host) {
|
|
|
56215
56216
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
56216
56217
|
}
|
|
56217
56218
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
56218
|
-
let
|
|
56219
|
+
let last2;
|
|
56219
56220
|
const types = [];
|
|
56220
56221
|
for (const sig of signatures) {
|
|
56221
56222
|
const pred = getTypePredicateOfSignature(sig);
|
|
56222
|
-
if (
|
|
56223
|
-
if (kind !==
|
|
56224
|
-
continue;
|
|
56225
|
-
} else {
|
|
56226
|
-
return;
|
|
56227
|
-
}
|
|
56228
|
-
}
|
|
56229
|
-
if (first2) {
|
|
56230
|
-
if (!typePredicateKindsMatch(first2, pred)) {
|
|
56223
|
+
if (pred) {
|
|
56224
|
+
if (pred.kind !== 0 /* This */ && pred.kind !== 1 /* Identifier */ || last2 && !typePredicateKindsMatch(last2, pred)) {
|
|
56231
56225
|
return void 0;
|
|
56232
56226
|
}
|
|
56227
|
+
last2 = pred;
|
|
56228
|
+
types.push(pred.type);
|
|
56233
56229
|
} else {
|
|
56234
|
-
|
|
56230
|
+
const returnType = kind !== 2097152 /* Intersection */ ? getReturnTypeOfSignature(sig) : void 0;
|
|
56231
|
+
if (returnType !== falseType && returnType !== regularFalseType) {
|
|
56232
|
+
return void 0;
|
|
56233
|
+
}
|
|
56235
56234
|
}
|
|
56236
|
-
types.push(pred.type);
|
|
56237
56235
|
}
|
|
56238
|
-
if (!
|
|
56236
|
+
if (!last2) {
|
|
56239
56237
|
return void 0;
|
|
56240
56238
|
}
|
|
56241
56239
|
const compositeType = getUnionOrIntersectionType(types, kind);
|
|
56242
|
-
return createTypePredicate(
|
|
56240
|
+
return createTypePredicate(last2.kind, last2.parameterName, last2.parameterIndex, compositeType);
|
|
56243
56241
|
}
|
|
56244
56242
|
function typePredicateKindsMatch(a, b) {
|
|
56245
56243
|
return a.kind === b.kind && a.parameterIndex === b.parameterIndex;
|
|
@@ -81676,7 +81674,7 @@ function createTypeChecker(host) {
|
|
|
81676
81674
|
if (requestedExternalEmitHelperNames.has(name))
|
|
81677
81675
|
continue;
|
|
81678
81676
|
requestedExternalEmitHelperNames.add(name);
|
|
81679
|
-
const symbol = getSymbol(helpersModule
|
|
81677
|
+
const symbol = getSymbol(getExportsOfModule(helpersModule), escapeLeadingUnderscores(name), 111551 /* Value */);
|
|
81680
81678
|
if (!symbol) {
|
|
81681
81679
|
error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name);
|
|
81682
81680
|
} else if (helper & 524288 /* ClassPrivateFieldGet */) {
|
package/lib/tsserver.js
CHANGED
|
@@ -2304,7 +2304,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2304
2304
|
|
|
2305
2305
|
// src/compiler/corePublic.ts
|
|
2306
2306
|
var versionMajorMinor = "5.2";
|
|
2307
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2307
|
+
var version = `${versionMajorMinor}.0-dev.20230520`;
|
|
2308
2308
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2309
2309
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2310
2310
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -11212,6 +11212,7 @@ var Diagnostics = {
|
|
|
11212
11212
|
Convert_typedef_to_TypeScript_type: diag(95176, 3 /* Message */, "Convert_typedef_to_TypeScript_type_95176", "Convert typedef to TypeScript type."),
|
|
11213
11213
|
Convert_all_typedef_to_TypeScript_types: diag(95177, 3 /* Message */, "Convert_all_typedef_to_TypeScript_types_95177", "Convert all typedef to TypeScript types."),
|
|
11214
11214
|
Move_to_file: diag(95178, 3 /* Message */, "Move_to_file_95178", "Move to file"),
|
|
11215
|
+
Cannot_move_to_file_selected_file_is_invalid: diag(95179, 3 /* Message */, "Cannot_move_to_file_selected_file_is_invalid_95179", "Cannot move to file, selected file is invalid"),
|
|
11215
11216
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
11216
11217
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
11217
11218
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
|
@@ -60866,31 +60867,28 @@ function createTypeChecker(host) {
|
|
|
60866
60867
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
60867
60868
|
}
|
|
60868
60869
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
60869
|
-
let
|
|
60870
|
+
let last2;
|
|
60870
60871
|
const types = [];
|
|
60871
60872
|
for (const sig of signatures) {
|
|
60872
60873
|
const pred = getTypePredicateOfSignature(sig);
|
|
60873
|
-
if (
|
|
60874
|
-
if (kind !==
|
|
60875
|
-
continue;
|
|
60876
|
-
} else {
|
|
60877
|
-
return;
|
|
60878
|
-
}
|
|
60879
|
-
}
|
|
60880
|
-
if (first2) {
|
|
60881
|
-
if (!typePredicateKindsMatch(first2, pred)) {
|
|
60874
|
+
if (pred) {
|
|
60875
|
+
if (pred.kind !== 0 /* This */ && pred.kind !== 1 /* Identifier */ || last2 && !typePredicateKindsMatch(last2, pred)) {
|
|
60882
60876
|
return void 0;
|
|
60883
60877
|
}
|
|
60878
|
+
last2 = pred;
|
|
60879
|
+
types.push(pred.type);
|
|
60884
60880
|
} else {
|
|
60885
|
-
|
|
60881
|
+
const returnType = kind !== 2097152 /* Intersection */ ? getReturnTypeOfSignature(sig) : void 0;
|
|
60882
|
+
if (returnType !== falseType && returnType !== regularFalseType) {
|
|
60883
|
+
return void 0;
|
|
60884
|
+
}
|
|
60886
60885
|
}
|
|
60887
|
-
types.push(pred.type);
|
|
60888
60886
|
}
|
|
60889
|
-
if (!
|
|
60887
|
+
if (!last2) {
|
|
60890
60888
|
return void 0;
|
|
60891
60889
|
}
|
|
60892
60890
|
const compositeType = getUnionOrIntersectionType(types, kind);
|
|
60893
|
-
return createTypePredicate(
|
|
60891
|
+
return createTypePredicate(last2.kind, last2.parameterName, last2.parameterIndex, compositeType);
|
|
60894
60892
|
}
|
|
60895
60893
|
function typePredicateKindsMatch(a, b) {
|
|
60896
60894
|
return a.kind === b.kind && a.parameterIndex === b.parameterIndex;
|
|
@@ -86327,7 +86325,7 @@ function createTypeChecker(host) {
|
|
|
86327
86325
|
if (requestedExternalEmitHelperNames.has(name))
|
|
86328
86326
|
continue;
|
|
86329
86327
|
requestedExternalEmitHelperNames.add(name);
|
|
86330
|
-
const symbol = getSymbol2(helpersModule
|
|
86328
|
+
const symbol = getSymbol2(getExportsOfModule(helpersModule), escapeLeadingUnderscores(name), 111551 /* Value */);
|
|
86331
86329
|
if (!symbol) {
|
|
86332
86330
|
error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name);
|
|
86333
86331
|
} else if (helper & 524288 /* ClassPrivateFieldGet */) {
|
|
@@ -136494,8 +136492,12 @@ registerRefactor(refactorNameForMoveToFile, {
|
|
|
136494
136492
|
Debug.assert(actionName2 === refactorNameForMoveToFile, "Wrong refactor invoked");
|
|
136495
136493
|
const statements = Debug.checkDefined(getStatementsToMove(context));
|
|
136496
136494
|
Debug.assert(interactiveRefactorArguments, "No interactive refactor arguments available");
|
|
136497
|
-
const
|
|
136498
|
-
|
|
136495
|
+
const targetFile = interactiveRefactorArguments.targetFile;
|
|
136496
|
+
if (hasJSFileExtension(targetFile) || hasTSFileExtension(targetFile)) {
|
|
136497
|
+
const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(context, context.file, interactiveRefactorArguments.targetFile, context.program, statements, t, context.host, context.preferences));
|
|
136498
|
+
return { edits, renameFilename: void 0, renameLocation: void 0 };
|
|
136499
|
+
}
|
|
136500
|
+
return { edits: [], renameFilename: void 0, renameLocation: void 0, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Cannot_move_to_file_selected_file_is_invalid) };
|
|
136499
136501
|
}
|
|
136500
136502
|
});
|
|
136501
136503
|
function doChange4(context, oldFile, targetFile, program, toMove, changes, host, preferences) {
|
|
@@ -182117,7 +182119,8 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
182117
182119
|
return {
|
|
182118
182120
|
renameLocation: mappedRenameLocation,
|
|
182119
182121
|
renameFilename,
|
|
182120
|
-
edits: this.mapTextChangesToCodeEdits(edits)
|
|
182122
|
+
edits: this.mapTextChangesToCodeEdits(edits),
|
|
182123
|
+
notApplicableReason: result.notApplicableReason
|
|
182121
182124
|
};
|
|
182122
182125
|
}
|
|
182123
182126
|
return result;
|
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -619,6 +619,7 @@ declare namespace ts {
|
|
|
619
619
|
*/
|
|
620
620
|
renameLocation?: Location;
|
|
621
621
|
renameFilename?: string;
|
|
622
|
+
notApplicableReason?: string;
|
|
622
623
|
}
|
|
623
624
|
/**
|
|
624
625
|
* Organize imports by:
|
|
@@ -10485,6 +10486,7 @@ declare namespace ts {
|
|
|
10485
10486
|
renameFilename?: string;
|
|
10486
10487
|
renameLocation?: number;
|
|
10487
10488
|
commands?: CodeActionCommand[];
|
|
10489
|
+
notApplicableReason?: string;
|
|
10488
10490
|
}
|
|
10489
10491
|
type RefactorTriggerReason = "implicit" | "invoked";
|
|
10490
10492
|
interface TextInsertion {
|
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.2";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230520`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -9018,6 +9018,7 @@ ${lanes.join("\n")}
|
|
|
9018
9018
|
Convert_typedef_to_TypeScript_type: diag(95176, 3 /* Message */, "Convert_typedef_to_TypeScript_type_95176", "Convert typedef to TypeScript type."),
|
|
9019
9019
|
Convert_all_typedef_to_TypeScript_types: diag(95177, 3 /* Message */, "Convert_all_typedef_to_TypeScript_types_95177", "Convert all typedef to TypeScript types."),
|
|
9020
9020
|
Move_to_file: diag(95178, 3 /* Message */, "Move_to_file_95178", "Move to file"),
|
|
9021
|
+
Cannot_move_to_file_selected_file_is_invalid: diag(95179, 3 /* Message */, "Cannot_move_to_file_selected_file_is_invalid_95179", "Cannot move to file, selected file is invalid"),
|
|
9021
9022
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
9022
9023
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
9023
9024
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
|
@@ -58657,31 +58658,28 @@ ${lanes.join("\n")}
|
|
|
58657
58658
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
58658
58659
|
}
|
|
58659
58660
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
58660
|
-
let
|
|
58661
|
+
let last2;
|
|
58661
58662
|
const types = [];
|
|
58662
58663
|
for (const sig of signatures) {
|
|
58663
58664
|
const pred = getTypePredicateOfSignature(sig);
|
|
58664
|
-
if (
|
|
58665
|
-
if (kind !==
|
|
58666
|
-
continue;
|
|
58667
|
-
} else {
|
|
58668
|
-
return;
|
|
58669
|
-
}
|
|
58670
|
-
}
|
|
58671
|
-
if (first2) {
|
|
58672
|
-
if (!typePredicateKindsMatch(first2, pred)) {
|
|
58665
|
+
if (pred) {
|
|
58666
|
+
if (pred.kind !== 0 /* This */ && pred.kind !== 1 /* Identifier */ || last2 && !typePredicateKindsMatch(last2, pred)) {
|
|
58673
58667
|
return void 0;
|
|
58674
58668
|
}
|
|
58669
|
+
last2 = pred;
|
|
58670
|
+
types.push(pred.type);
|
|
58675
58671
|
} else {
|
|
58676
|
-
|
|
58672
|
+
const returnType = kind !== 2097152 /* Intersection */ ? getReturnTypeOfSignature(sig) : void 0;
|
|
58673
|
+
if (returnType !== falseType && returnType !== regularFalseType) {
|
|
58674
|
+
return void 0;
|
|
58675
|
+
}
|
|
58677
58676
|
}
|
|
58678
|
-
types.push(pred.type);
|
|
58679
58677
|
}
|
|
58680
|
-
if (!
|
|
58678
|
+
if (!last2) {
|
|
58681
58679
|
return void 0;
|
|
58682
58680
|
}
|
|
58683
58681
|
const compositeType = getUnionOrIntersectionType(types, kind);
|
|
58684
|
-
return createTypePredicate(
|
|
58682
|
+
return createTypePredicate(last2.kind, last2.parameterName, last2.parameterIndex, compositeType);
|
|
58685
58683
|
}
|
|
58686
58684
|
function typePredicateKindsMatch(a, b) {
|
|
58687
58685
|
return a.kind === b.kind && a.parameterIndex === b.parameterIndex;
|
|
@@ -84118,7 +84116,7 @@ ${lanes.join("\n")}
|
|
|
84118
84116
|
if (requestedExternalEmitHelperNames.has(name))
|
|
84119
84117
|
continue;
|
|
84120
84118
|
requestedExternalEmitHelperNames.add(name);
|
|
84121
|
-
const symbol = getSymbol2(helpersModule
|
|
84119
|
+
const symbol = getSymbol2(getExportsOfModule(helpersModule), escapeLeadingUnderscores(name), 111551 /* Value */);
|
|
84122
84120
|
if (!symbol) {
|
|
84123
84121
|
error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name);
|
|
84124
84122
|
} else if (helper & 524288 /* ClassPrivateFieldGet */) {
|
|
@@ -135741,8 +135739,12 @@ ${lanes.join("\n")}
|
|
|
135741
135739
|
Debug.assert(actionName2 === refactorNameForMoveToFile, "Wrong refactor invoked");
|
|
135742
135740
|
const statements = Debug.checkDefined(getStatementsToMove(context));
|
|
135743
135741
|
Debug.assert(interactiveRefactorArguments, "No interactive refactor arguments available");
|
|
135744
|
-
const
|
|
135745
|
-
|
|
135742
|
+
const targetFile = interactiveRefactorArguments.targetFile;
|
|
135743
|
+
if (hasJSFileExtension(targetFile) || hasTSFileExtension(targetFile)) {
|
|
135744
|
+
const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(context, context.file, interactiveRefactorArguments.targetFile, context.program, statements, t, context.host, context.preferences));
|
|
135745
|
+
return { edits, renameFilename: void 0, renameLocation: void 0 };
|
|
135746
|
+
}
|
|
135747
|
+
return { edits: [], renameFilename: void 0, renameLocation: void 0, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Cannot_move_to_file_selected_file_is_invalid) };
|
|
135746
135748
|
}
|
|
135747
135749
|
});
|
|
135748
135750
|
}
|
|
@@ -179555,7 +179557,8 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
179555
179557
|
return {
|
|
179556
179558
|
renameLocation: mappedRenameLocation,
|
|
179557
179559
|
renameFilename,
|
|
179558
|
-
edits: this.mapTextChangesToCodeEdits(edits)
|
|
179560
|
+
edits: this.mapTextChangesToCodeEdits(edits),
|
|
179561
|
+
notApplicableReason: result.notApplicableReason
|
|
179559
179562
|
};
|
|
179560
179563
|
}
|
|
179561
179564
|
return result;
|
package/lib/typescript.d.ts
CHANGED
|
@@ -6517,6 +6517,7 @@ declare namespace ts {
|
|
|
6517
6517
|
renameFilename?: string;
|
|
6518
6518
|
renameLocation?: number;
|
|
6519
6519
|
commands?: CodeActionCommand[];
|
|
6520
|
+
notApplicableReason?: string;
|
|
6520
6521
|
}
|
|
6521
6522
|
type RefactorTriggerReason = "implicit" | "invoked";
|
|
6522
6523
|
interface TextInsertion {
|
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.2";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230520`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -9018,6 +9018,7 @@ ${lanes.join("\n")}
|
|
|
9018
9018
|
Convert_typedef_to_TypeScript_type: diag(95176, 3 /* Message */, "Convert_typedef_to_TypeScript_type_95176", "Convert typedef to TypeScript type."),
|
|
9019
9019
|
Convert_all_typedef_to_TypeScript_types: diag(95177, 3 /* Message */, "Convert_all_typedef_to_TypeScript_types_95177", "Convert all typedef to TypeScript types."),
|
|
9020
9020
|
Move_to_file: diag(95178, 3 /* Message */, "Move_to_file_95178", "Move to file"),
|
|
9021
|
+
Cannot_move_to_file_selected_file_is_invalid: diag(95179, 3 /* Message */, "Cannot_move_to_file_selected_file_is_invalid_95179", "Cannot move to file, selected file is invalid"),
|
|
9021
9022
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
9022
9023
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
9023
9024
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
|
@@ -58657,31 +58658,28 @@ ${lanes.join("\n")}
|
|
|
58657
58658
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
58658
58659
|
}
|
|
58659
58660
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
58660
|
-
let
|
|
58661
|
+
let last2;
|
|
58661
58662
|
const types = [];
|
|
58662
58663
|
for (const sig of signatures) {
|
|
58663
58664
|
const pred = getTypePredicateOfSignature(sig);
|
|
58664
|
-
if (
|
|
58665
|
-
if (kind !==
|
|
58666
|
-
continue;
|
|
58667
|
-
} else {
|
|
58668
|
-
return;
|
|
58669
|
-
}
|
|
58670
|
-
}
|
|
58671
|
-
if (first2) {
|
|
58672
|
-
if (!typePredicateKindsMatch(first2, pred)) {
|
|
58665
|
+
if (pred) {
|
|
58666
|
+
if (pred.kind !== 0 /* This */ && pred.kind !== 1 /* Identifier */ || last2 && !typePredicateKindsMatch(last2, pred)) {
|
|
58673
58667
|
return void 0;
|
|
58674
58668
|
}
|
|
58669
|
+
last2 = pred;
|
|
58670
|
+
types.push(pred.type);
|
|
58675
58671
|
} else {
|
|
58676
|
-
|
|
58672
|
+
const returnType = kind !== 2097152 /* Intersection */ ? getReturnTypeOfSignature(sig) : void 0;
|
|
58673
|
+
if (returnType !== falseType && returnType !== regularFalseType) {
|
|
58674
|
+
return void 0;
|
|
58675
|
+
}
|
|
58677
58676
|
}
|
|
58678
|
-
types.push(pred.type);
|
|
58679
58677
|
}
|
|
58680
|
-
if (!
|
|
58678
|
+
if (!last2) {
|
|
58681
58679
|
return void 0;
|
|
58682
58680
|
}
|
|
58683
58681
|
const compositeType = getUnionOrIntersectionType(types, kind);
|
|
58684
|
-
return createTypePredicate(
|
|
58682
|
+
return createTypePredicate(last2.kind, last2.parameterName, last2.parameterIndex, compositeType);
|
|
58685
58683
|
}
|
|
58686
58684
|
function typePredicateKindsMatch(a, b) {
|
|
58687
58685
|
return a.kind === b.kind && a.parameterIndex === b.parameterIndex;
|
|
@@ -84118,7 +84116,7 @@ ${lanes.join("\n")}
|
|
|
84118
84116
|
if (requestedExternalEmitHelperNames.has(name))
|
|
84119
84117
|
continue;
|
|
84120
84118
|
requestedExternalEmitHelperNames.add(name);
|
|
84121
|
-
const symbol = getSymbol2(helpersModule
|
|
84119
|
+
const symbol = getSymbol2(getExportsOfModule(helpersModule), escapeLeadingUnderscores(name), 111551 /* Value */);
|
|
84122
84120
|
if (!symbol) {
|
|
84123
84121
|
error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name);
|
|
84124
84122
|
} else if (helper & 524288 /* ClassPrivateFieldGet */) {
|
|
@@ -135756,8 +135754,12 @@ ${lanes.join("\n")}
|
|
|
135756
135754
|
Debug.assert(actionName2 === refactorNameForMoveToFile, "Wrong refactor invoked");
|
|
135757
135755
|
const statements = Debug.checkDefined(getStatementsToMove(context));
|
|
135758
135756
|
Debug.assert(interactiveRefactorArguments, "No interactive refactor arguments available");
|
|
135759
|
-
const
|
|
135760
|
-
|
|
135757
|
+
const targetFile = interactiveRefactorArguments.targetFile;
|
|
135758
|
+
if (hasJSFileExtension(targetFile) || hasTSFileExtension(targetFile)) {
|
|
135759
|
+
const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(context, context.file, interactiveRefactorArguments.targetFile, context.program, statements, t, context.host, context.preferences));
|
|
135760
|
+
return { edits, renameFilename: void 0, renameLocation: void 0 };
|
|
135761
|
+
}
|
|
135762
|
+
return { edits: [], renameFilename: void 0, renameLocation: void 0, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Cannot_move_to_file_selected_file_is_invalid) };
|
|
135761
135763
|
}
|
|
135762
135764
|
});
|
|
135763
135765
|
}
|
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.2";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20230520`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -7078,6 +7078,7 @@ var Diagnostics = {
|
|
|
7078
7078
|
Convert_typedef_to_TypeScript_type: diag(95176, 3 /* Message */, "Convert_typedef_to_TypeScript_type_95176", "Convert typedef to TypeScript type."),
|
|
7079
7079
|
Convert_all_typedef_to_TypeScript_types: diag(95177, 3 /* Message */, "Convert_all_typedef_to_TypeScript_types_95177", "Convert all typedef to TypeScript types."),
|
|
7080
7080
|
Move_to_file: diag(95178, 3 /* Message */, "Move_to_file_95178", "Move to file"),
|
|
7081
|
+
Cannot_move_to_file_selected_file_is_invalid: diag(95179, 3 /* Message */, "Cannot_move_to_file_selected_file_is_invalid_95179", "Cannot move to file, selected file is invalid"),
|
|
7081
7082
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
7082
7083
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
7083
7084
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
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.2.0-dev.
|
|
5
|
+
"version": "5.2.0-dev.20230520",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"node": "20.1.0",
|
|
114
114
|
"npm": "8.19.4"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "04cdffdd2785128bb3c03fa189eb7d3728d1a20b"
|
|
117
117
|
}
|