@typescript-deploys/pr-build 5.2.0-pr-54290-7 → 5.2.0-pr-54316-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +17 -22
- package/lib/tsserver.js +96 -51
- package/lib/tsserverlibrary.d.ts +8 -0
- package/lib/tsserverlibrary.js +96 -51
- package/lib/typescript.d.ts +2 -0
- package/lib/typescript.js +92 -50
- package/lib/typingsInstaller.js +7 -2
- 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-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20230518`;
|
|
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?"),
|
|
@@ -18559,7 +18560,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
18559
18560
|
ensureUseStrict,
|
|
18560
18561
|
liftToBlock,
|
|
18561
18562
|
mergeLexicalEnvironment,
|
|
18562
|
-
updateModifiers
|
|
18563
|
+
updateModifiers,
|
|
18564
|
+
updateModifierLike
|
|
18563
18565
|
};
|
|
18564
18566
|
forEach(nodeFactoryPatchers, (fn) => fn(factory2));
|
|
18565
18567
|
return factory2;
|
|
@@ -22041,6 +22043,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22041
22043
|
}
|
|
22042
22044
|
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
|
|
22043
22045
|
}
|
|
22046
|
+
function updateModifierLike(node, modifierArray) {
|
|
22047
|
+
return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
|
|
22048
|
+
}
|
|
22044
22049
|
function asNodeArray(array) {
|
|
22045
22050
|
return array ? createNodeArray(array) : void 0;
|
|
22046
22051
|
}
|
|
@@ -23366,10 +23371,10 @@ var esDecorateHelper = {
|
|
|
23366
23371
|
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23367
23372
|
if (_ = accept(result.get)) descriptor.get = _;
|
|
23368
23373
|
if (_ = accept(result.set)) descriptor.set = _;
|
|
23369
|
-
if (_ = accept(result.init)) initializers.
|
|
23374
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
23370
23375
|
}
|
|
23371
23376
|
else if (_ = accept(result)) {
|
|
23372
|
-
if (kind === "field") initializers.
|
|
23377
|
+
if (kind === "field") initializers.unshift(_);
|
|
23373
23378
|
else descriptor[key] = _;
|
|
23374
23379
|
}
|
|
23375
23380
|
}
|
|
@@ -69671,7 +69676,7 @@ function createTypeChecker(host) {
|
|
|
69671
69676
|
}
|
|
69672
69677
|
const typeArgument = typeArgumentTypes[i];
|
|
69673
69678
|
if (!checkTypeAssignableTo(
|
|
69674
|
-
|
|
69679
|
+
typeArgument,
|
|
69675
69680
|
getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument),
|
|
69676
69681
|
reportErrors2 ? typeArgumentNodes[i] : void 0,
|
|
69677
69682
|
typeArgumentHeadMessage,
|
|
@@ -118750,7 +118755,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
118750
118755
|
let filesWithChangedSetOfUnresolvedImports;
|
|
118751
118756
|
let filesWithInvalidatedResolutions;
|
|
118752
118757
|
let filesWithInvalidatedNonRelativeUnresolvedImports;
|
|
118753
|
-
const nonRelativeExternalModuleResolutions =
|
|
118758
|
+
const nonRelativeExternalModuleResolutions = /* @__PURE__ */ new Set();
|
|
118754
118759
|
const resolutionsWithFailedLookups = /* @__PURE__ */ new Set();
|
|
118755
118760
|
const resolutionsWithOnlyAffectingLocations = /* @__PURE__ */ new Set();
|
|
118756
118761
|
const resolvedFileToResolution = /* @__PURE__ */ new Map();
|
|
@@ -118884,8 +118889,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
118884
118889
|
moduleResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
118885
118890
|
typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
118886
118891
|
libraryResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
118887
|
-
|
|
118888
|
-
nonRelativeExternalModuleResolutions.clear();
|
|
118892
|
+
watchFailedLookupLocationOfNonRelativeModuleResolutions();
|
|
118889
118893
|
}
|
|
118890
118894
|
function cleanupLibResolutionWatching(newProgram) {
|
|
118891
118895
|
resolvedLibraries.forEach((resolution, libFileName) => {
|
|
@@ -118903,8 +118907,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
118903
118907
|
function finishCachingPerDirectoryResolution(newProgram, oldProgram) {
|
|
118904
118908
|
filesWithInvalidatedNonRelativeUnresolvedImports = void 0;
|
|
118905
118909
|
allModuleAndTypeResolutionsAreInvalidated = false;
|
|
118906
|
-
|
|
118907
|
-
nonRelativeExternalModuleResolutions.clear();
|
|
118910
|
+
watchFailedLookupLocationOfNonRelativeModuleResolutions();
|
|
118908
118911
|
if (newProgram !== oldProgram) {
|
|
118909
118912
|
cleanupLibResolutionWatching(newProgram);
|
|
118910
118913
|
newProgram == null ? void 0 : newProgram.getSourceFiles().forEach((newFile) => {
|
|
@@ -119185,7 +119188,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
119185
119188
|
if (!deferWatchingNonRelativeResolution || isExternalModuleNameRelative(name)) {
|
|
119186
119189
|
watchFailedLookupLocationOfResolution(resolution);
|
|
119187
119190
|
} else {
|
|
119188
|
-
nonRelativeExternalModuleResolutions.add(
|
|
119191
|
+
nonRelativeExternalModuleResolutions.add(resolution);
|
|
119189
119192
|
}
|
|
119190
119193
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
119191
119194
|
if (resolved && resolved.resolvedFileName) {
|
|
@@ -119315,17 +119318,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
119315
119318
|
paths.add(affectingLocation);
|
|
119316
119319
|
}
|
|
119317
119320
|
}
|
|
119318
|
-
function watchFailedLookupLocationOfNonRelativeModuleResolutions(
|
|
119319
|
-
|
|
119320
|
-
|
|
119321
|
-
resolutions.forEach(watchFailedLookupLocationOfResolution);
|
|
119322
|
-
} else {
|
|
119323
|
-
resolutions.forEach((resolution) => watchAffectingLocationsOfResolution(
|
|
119324
|
-
resolution,
|
|
119325
|
-
/*addToResolutionsWithOnlyAffectingLocations*/
|
|
119326
|
-
true
|
|
119327
|
-
));
|
|
119328
|
-
}
|
|
119321
|
+
function watchFailedLookupLocationOfNonRelativeModuleResolutions() {
|
|
119322
|
+
nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfResolution);
|
|
119323
|
+
nonRelativeExternalModuleResolutions.clear();
|
|
119329
119324
|
}
|
|
119330
119325
|
function setDirectoryWatcher(dir, dirPath, nonRecursive) {
|
|
119331
119326
|
const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
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-insiders.
|
|
2307
|
+
var version = `${versionMajorMinor}.0-insiders.20230518`;
|
|
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?"),
|
|
@@ -22754,7 +22755,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22754
22755
|
ensureUseStrict,
|
|
22755
22756
|
liftToBlock,
|
|
22756
22757
|
mergeLexicalEnvironment,
|
|
22757
|
-
updateModifiers
|
|
22758
|
+
updateModifiers,
|
|
22759
|
+
updateModifierLike
|
|
22758
22760
|
};
|
|
22759
22761
|
forEach(nodeFactoryPatchers, (fn) => fn(factory2));
|
|
22760
22762
|
return factory2;
|
|
@@ -26236,6 +26238,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
26236
26238
|
}
|
|
26237
26239
|
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
|
|
26238
26240
|
}
|
|
26241
|
+
function updateModifierLike(node, modifierArray) {
|
|
26242
|
+
return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
|
|
26243
|
+
}
|
|
26239
26244
|
function asNodeArray(array) {
|
|
26240
26245
|
return array ? createNodeArray(array) : void 0;
|
|
26241
26246
|
}
|
|
@@ -27617,10 +27622,10 @@ var esDecorateHelper = {
|
|
|
27617
27622
|
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
27618
27623
|
if (_ = accept(result.get)) descriptor.get = _;
|
|
27619
27624
|
if (_ = accept(result.set)) descriptor.set = _;
|
|
27620
|
-
if (_ = accept(result.init)) initializers.
|
|
27625
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
27621
27626
|
}
|
|
27622
27627
|
else if (_ = accept(result)) {
|
|
27623
|
-
if (kind === "field") initializers.
|
|
27628
|
+
if (kind === "field") initializers.unshift(_);
|
|
27624
27629
|
else descriptor[key] = _;
|
|
27625
27630
|
}
|
|
27626
27631
|
}
|
|
@@ -74322,7 +74327,7 @@ function createTypeChecker(host) {
|
|
|
74322
74327
|
}
|
|
74323
74328
|
const typeArgument = typeArgumentTypes[i];
|
|
74324
74329
|
if (!checkTypeAssignableTo(
|
|
74325
|
-
|
|
74330
|
+
typeArgument,
|
|
74326
74331
|
getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument),
|
|
74327
74332
|
reportErrors2 ? typeArgumentNodes[i] : void 0,
|
|
74328
74333
|
typeArgumentHeadMessage,
|
|
@@ -123672,7 +123677,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
123672
123677
|
let filesWithChangedSetOfUnresolvedImports;
|
|
123673
123678
|
let filesWithInvalidatedResolutions;
|
|
123674
123679
|
let filesWithInvalidatedNonRelativeUnresolvedImports;
|
|
123675
|
-
const nonRelativeExternalModuleResolutions =
|
|
123680
|
+
const nonRelativeExternalModuleResolutions = /* @__PURE__ */ new Set();
|
|
123676
123681
|
const resolutionsWithFailedLookups = /* @__PURE__ */ new Set();
|
|
123677
123682
|
const resolutionsWithOnlyAffectingLocations = /* @__PURE__ */ new Set();
|
|
123678
123683
|
const resolvedFileToResolution = /* @__PURE__ */ new Map();
|
|
@@ -123806,8 +123811,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
123806
123811
|
moduleResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
123807
123812
|
typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
123808
123813
|
libraryResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
123809
|
-
|
|
123810
|
-
nonRelativeExternalModuleResolutions.clear();
|
|
123814
|
+
watchFailedLookupLocationOfNonRelativeModuleResolutions();
|
|
123811
123815
|
}
|
|
123812
123816
|
function cleanupLibResolutionWatching(newProgram) {
|
|
123813
123817
|
resolvedLibraries.forEach((resolution, libFileName) => {
|
|
@@ -123825,8 +123829,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
123825
123829
|
function finishCachingPerDirectoryResolution(newProgram, oldProgram) {
|
|
123826
123830
|
filesWithInvalidatedNonRelativeUnresolvedImports = void 0;
|
|
123827
123831
|
allModuleAndTypeResolutionsAreInvalidated = false;
|
|
123828
|
-
|
|
123829
|
-
nonRelativeExternalModuleResolutions.clear();
|
|
123832
|
+
watchFailedLookupLocationOfNonRelativeModuleResolutions();
|
|
123830
123833
|
if (newProgram !== oldProgram) {
|
|
123831
123834
|
cleanupLibResolutionWatching(newProgram);
|
|
123832
123835
|
newProgram == null ? void 0 : newProgram.getSourceFiles().forEach((newFile) => {
|
|
@@ -124107,7 +124110,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
124107
124110
|
if (!deferWatchingNonRelativeResolution || isExternalModuleNameRelative(name)) {
|
|
124108
124111
|
watchFailedLookupLocationOfResolution(resolution);
|
|
124109
124112
|
} else {
|
|
124110
|
-
nonRelativeExternalModuleResolutions.add(
|
|
124113
|
+
nonRelativeExternalModuleResolutions.add(resolution);
|
|
124111
124114
|
}
|
|
124112
124115
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
124113
124116
|
if (resolved && resolved.resolvedFileName) {
|
|
@@ -124237,17 +124240,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
124237
124240
|
paths.add(affectingLocation);
|
|
124238
124241
|
}
|
|
124239
124242
|
}
|
|
124240
|
-
function watchFailedLookupLocationOfNonRelativeModuleResolutions(
|
|
124241
|
-
|
|
124242
|
-
|
|
124243
|
-
resolutions.forEach(watchFailedLookupLocationOfResolution);
|
|
124244
|
-
} else {
|
|
124245
|
-
resolutions.forEach((resolution) => watchAffectingLocationsOfResolution(
|
|
124246
|
-
resolution,
|
|
124247
|
-
/*addToResolutionsWithOnlyAffectingLocations*/
|
|
124248
|
-
true
|
|
124249
|
-
));
|
|
124250
|
-
}
|
|
124243
|
+
function watchFailedLookupLocationOfNonRelativeModuleResolutions() {
|
|
124244
|
+
nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfResolution);
|
|
124245
|
+
nonRelativeExternalModuleResolutions.clear();
|
|
124251
124246
|
}
|
|
124252
124247
|
function setDirectoryWatcher(dir, dirPath, nonRecursive) {
|
|
124253
124248
|
const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
|
@@ -136490,8 +136485,12 @@ registerRefactor(refactorNameForMoveToFile, {
|
|
|
136490
136485
|
Debug.assert(actionName2 === refactorNameForMoveToFile, "Wrong refactor invoked");
|
|
136491
136486
|
const statements = Debug.checkDefined(getStatementsToMove(context));
|
|
136492
136487
|
Debug.assert(interactiveRefactorArguments, "No interactive refactor arguments available");
|
|
136493
|
-
const
|
|
136494
|
-
|
|
136488
|
+
const targetFile = interactiveRefactorArguments.targetFile;
|
|
136489
|
+
if (hasJSFileExtension(targetFile) || hasTSFileExtension(targetFile)) {
|
|
136490
|
+
const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(context, context.file, interactiveRefactorArguments.targetFile, context.program, statements, t, context.host, context.preferences));
|
|
136491
|
+
return { edits, renameFilename: void 0, renameLocation: void 0 };
|
|
136492
|
+
}
|
|
136493
|
+
return { edits: [], renameFilename: void 0, renameLocation: void 0, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Cannot_move_to_file_selected_file_is_invalid) };
|
|
136495
136494
|
}
|
|
136496
136495
|
});
|
|
136497
136496
|
function doChange4(context, oldFile, targetFile, program, toMove, changes, host, preferences) {
|
|
@@ -153173,7 +153172,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
|
|
|
153173
153172
|
false
|
|
153174
153173
|
);
|
|
153175
153174
|
const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
|
|
153176
|
-
let modifierFlags = effectiveModifierFlags &
|
|
153175
|
+
let modifierFlags = effectiveModifierFlags & 32 /* Static */;
|
|
153176
|
+
modifierFlags |= effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
|
|
153177
153177
|
if (declaration && isAutoAccessorPropertyDeclaration(declaration)) {
|
|
153178
153178
|
modifierFlags |= 128 /* Accessor */;
|
|
153179
153179
|
}
|
|
@@ -155745,6 +155745,7 @@ function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
|
|
|
155745
155745
|
}
|
|
155746
155746
|
function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) {
|
|
155747
155747
|
let insertText;
|
|
155748
|
+
let filterText;
|
|
155748
155749
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
155749
155750
|
let data;
|
|
155750
155751
|
let isSnippet;
|
|
@@ -155803,11 +155804,15 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
155803
155804
|
}
|
|
155804
155805
|
if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
155805
155806
|
let importAdder;
|
|
155806
|
-
|
|
155807
|
-
|
|
155808
|
-
|
|
155809
|
-
|
|
155810
|
-
|
|
155807
|
+
const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
|
|
155808
|
+
if (memberCompletionEntry) {
|
|
155809
|
+
({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
|
|
155810
|
+
if (importAdder == null ? void 0 : importAdder.hasFixes()) {
|
|
155811
|
+
hasAction = true;
|
|
155812
|
+
source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
|
|
155813
|
+
}
|
|
155814
|
+
} else {
|
|
155815
|
+
return void 0;
|
|
155811
155816
|
}
|
|
155812
155817
|
}
|
|
155813
155818
|
if (origin && originIsObjectLiteralMethod(origin)) {
|
|
@@ -155851,6 +155856,7 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
155851
155856
|
hasAction: hasAction ? true : void 0,
|
|
155852
155857
|
isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0,
|
|
155853
155858
|
insertText,
|
|
155859
|
+
filterText,
|
|
155854
155860
|
replacementSpan,
|
|
155855
155861
|
sourceDisplay,
|
|
155856
155862
|
labelDetails,
|
|
@@ -155871,11 +155877,11 @@ function isClassLikeMemberCompletion(symbol, location, sourceFile) {
|
|
|
155871
155877
|
function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) {
|
|
155872
155878
|
const classLikeDeclaration = findAncestor(location, isClassLike);
|
|
155873
155879
|
if (!classLikeDeclaration) {
|
|
155874
|
-
return
|
|
155880
|
+
return void 0;
|
|
155875
155881
|
}
|
|
155876
155882
|
let isSnippet;
|
|
155877
|
-
let replacementSpan;
|
|
155878
155883
|
let insertText = name;
|
|
155884
|
+
const filterText = name;
|
|
155879
155885
|
const checker = program.getTypeChecker();
|
|
155880
155886
|
const sourceFile = location.getSourceFile();
|
|
155881
155887
|
const printer = createSnippetPrinter({
|
|
@@ -155904,9 +155910,9 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
155904
155910
|
);
|
|
155905
155911
|
}
|
|
155906
155912
|
let modifiers = 0 /* None */;
|
|
155907
|
-
const { modifiers: presentModifiers,
|
|
155908
|
-
const isAbstract =
|
|
155909
|
-
|
|
155913
|
+
const { modifiers: presentModifiers, range: eraseRange, decorators: presentDecorators } = getPresentModifiers(contextToken, sourceFile, position);
|
|
155914
|
+
const isAbstract = presentModifiers & 256 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 256 /* Abstract */;
|
|
155915
|
+
let completionNodes = [];
|
|
155910
155916
|
ts_codefix_exports.addNewNodeForMemberSymbol(
|
|
155911
155917
|
symbol,
|
|
155912
155918
|
classLikeDeclaration,
|
|
@@ -155930,18 +155936,42 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
155930
155936
|
requiredModifiers |= 16384 /* Override */;
|
|
155931
155937
|
}
|
|
155932
155938
|
if (!completionNodes.length) {
|
|
155933
|
-
modifiers = node.modifierFlagsCache | requiredModifiers
|
|
155939
|
+
modifiers = node.modifierFlagsCache | requiredModifiers;
|
|
155934
155940
|
}
|
|
155935
155941
|
node = factory.updateModifiers(node, modifiers);
|
|
155936
155942
|
completionNodes.push(node);
|
|
155937
155943
|
},
|
|
155938
155944
|
body,
|
|
155939
155945
|
ts_codefix_exports.PreserveOptionalFlags.Property,
|
|
155940
|
-
isAbstract
|
|
155946
|
+
!!isAbstract
|
|
155941
155947
|
);
|
|
155942
155948
|
if (completionNodes.length) {
|
|
155949
|
+
const isMethod = symbol.flags & 8192 /* Method */;
|
|
155950
|
+
let allowedModifiers = modifiers | 16384 /* Override */ | 4 /* Public */;
|
|
155951
|
+
if (!isMethod) {
|
|
155952
|
+
allowedModifiers |= 2 /* Ambient */ | 64 /* Readonly */;
|
|
155953
|
+
} else {
|
|
155954
|
+
allowedModifiers |= 512 /* Async */;
|
|
155955
|
+
}
|
|
155956
|
+
const allowedAndPresent = presentModifiers & allowedModifiers;
|
|
155957
|
+
if (presentModifiers & ~allowedModifiers) {
|
|
155958
|
+
return void 0;
|
|
155959
|
+
}
|
|
155960
|
+
if (modifiers & 16 /* Protected */ && allowedAndPresent & 4 /* Public */) {
|
|
155961
|
+
modifiers &= ~16 /* Protected */;
|
|
155962
|
+
}
|
|
155963
|
+
if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 4 /* Public */)) {
|
|
155964
|
+
modifiers &= ~4 /* Public */;
|
|
155965
|
+
}
|
|
155966
|
+
modifiers |= allowedAndPresent;
|
|
155967
|
+
completionNodes = completionNodes.map((node) => factory.updateModifiers(node, modifiers));
|
|
155968
|
+
if (presentDecorators == null ? void 0 : presentDecorators.length) {
|
|
155969
|
+
const lastNode = completionNodes[completionNodes.length - 1];
|
|
155970
|
+
if (canHaveDecorators(lastNode)) {
|
|
155971
|
+
completionNodes[completionNodes.length - 1] = factory.updateModifierLike(lastNode, presentDecorators.concat(getModifiers(lastNode) || []));
|
|
155972
|
+
}
|
|
155973
|
+
}
|
|
155943
155974
|
const format = 1 /* MultiLine */ | 131072 /* NoTrailingNewLine */;
|
|
155944
|
-
replacementSpan = modifiersSpan;
|
|
155945
155975
|
if (formatContext) {
|
|
155946
155976
|
insertText = printer.printAndFormatSnippetList(
|
|
155947
155977
|
format,
|
|
@@ -155957,24 +155987,29 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
155957
155987
|
);
|
|
155958
155988
|
}
|
|
155959
155989
|
}
|
|
155960
|
-
return { insertText, isSnippet, importAdder,
|
|
155990
|
+
return { insertText, filterText, isSnippet, importAdder, eraseRange };
|
|
155961
155991
|
}
|
|
155962
155992
|
function getPresentModifiers(contextToken, sourceFile, position) {
|
|
155963
155993
|
if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) {
|
|
155964
155994
|
return { modifiers: 0 /* None */ };
|
|
155965
155995
|
}
|
|
155966
155996
|
let modifiers = 0 /* None */;
|
|
155967
|
-
let
|
|
155997
|
+
let decorators;
|
|
155968
155998
|
let contextMod;
|
|
155969
|
-
|
|
155970
|
-
|
|
155971
|
-
span = createTextSpanFromNode(contextToken);
|
|
155972
|
-
}
|
|
155973
|
-
if (isPropertyDeclaration(contextToken.parent)) {
|
|
155999
|
+
const range = { pos: position, end: position };
|
|
156000
|
+
if (isPropertyDeclaration(contextToken.parent) && contextToken.parent.modifiers) {
|
|
155974
156001
|
modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 126975 /* Modifier */;
|
|
155975
|
-
|
|
156002
|
+
decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
|
|
156003
|
+
range.pos = Math.min(range.pos, contextToken.parent.modifiers.pos);
|
|
156004
|
+
}
|
|
156005
|
+
if (contextMod = isModifierLike2(contextToken)) {
|
|
156006
|
+
const contextModifierFlag = modifierToFlag(contextMod);
|
|
156007
|
+
if (!(modifiers & contextModifierFlag)) {
|
|
156008
|
+
modifiers |= contextModifierFlag;
|
|
156009
|
+
range.pos = Math.min(range.pos, contextToken.pos);
|
|
156010
|
+
}
|
|
155976
156011
|
}
|
|
155977
|
-
return { modifiers,
|
|
156012
|
+
return { modifiers, decorators, range: range.pos !== position ? range : void 0 };
|
|
155978
156013
|
}
|
|
155979
156014
|
function isModifierLike2(node) {
|
|
155980
156015
|
if (isModifier(node)) {
|
|
@@ -156597,7 +156632,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
|
|
|
156597
156632
|
}
|
|
156598
156633
|
}
|
|
156599
156634
|
if (source === "ClassMemberSnippet/" /* ClassMemberSnippet */) {
|
|
156600
|
-
const { importAdder } = getEntryForMemberCompletion(
|
|
156635
|
+
const { importAdder, eraseRange } = getEntryForMemberCompletion(
|
|
156601
156636
|
host,
|
|
156602
156637
|
program,
|
|
156603
156638
|
compilerOptions,
|
|
@@ -156609,10 +156644,17 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
|
|
|
156609
156644
|
contextToken,
|
|
156610
156645
|
formatContext
|
|
156611
156646
|
);
|
|
156612
|
-
if (importAdder) {
|
|
156647
|
+
if (importAdder || eraseRange) {
|
|
156613
156648
|
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
156614
156649
|
{ host, formatContext, preferences },
|
|
156615
|
-
|
|
156650
|
+
(tracker) => {
|
|
156651
|
+
if (importAdder) {
|
|
156652
|
+
importAdder.writeFixes(tracker);
|
|
156653
|
+
}
|
|
156654
|
+
if (eraseRange) {
|
|
156655
|
+
tracker.deleteRange(sourceFile, eraseRange);
|
|
156656
|
+
}
|
|
156657
|
+
}
|
|
156616
156658
|
);
|
|
156617
156659
|
return {
|
|
156618
156660
|
sourceDisplay: void 0,
|
|
@@ -181679,6 +181721,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
181679
181721
|
kindModifiers,
|
|
181680
181722
|
sortText,
|
|
181681
181723
|
insertText,
|
|
181724
|
+
filterText,
|
|
181682
181725
|
replacementSpan,
|
|
181683
181726
|
hasAction,
|
|
181684
181727
|
source,
|
|
@@ -181697,6 +181740,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
181697
181740
|
kindModifiers,
|
|
181698
181741
|
sortText,
|
|
181699
181742
|
insertText,
|
|
181743
|
+
filterText,
|
|
181700
181744
|
replacementSpan: convertedSpan,
|
|
181701
181745
|
isSnippet,
|
|
181702
181746
|
hasAction: hasAction || void 0,
|
|
@@ -182068,7 +182112,8 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
182068
182112
|
return {
|
|
182069
182113
|
renameLocation: mappedRenameLocation,
|
|
182070
182114
|
renameFilename,
|
|
182071
|
-
edits: this.mapTextChangesToCodeEdits(edits)
|
|
182115
|
+
edits: this.mapTextChangesToCodeEdits(edits),
|
|
182116
|
+
notApplicableReason: result.notApplicableReason
|
|
182072
182117
|
};
|
|
182073
182118
|
}
|
|
182074
182119
|
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:
|
|
@@ -1829,6 +1830,11 @@ declare namespace ts {
|
|
|
1829
1830
|
* coupled with `replacementSpan` to replace a dotted access with a bracket access.
|
|
1830
1831
|
*/
|
|
1831
1832
|
insertText?: string;
|
|
1833
|
+
/**
|
|
1834
|
+
* A string that should be used when filtering a set of
|
|
1835
|
+
* completion items.
|
|
1836
|
+
*/
|
|
1837
|
+
filterText?: string;
|
|
1832
1838
|
/**
|
|
1833
1839
|
* `insertText` should be interpreted as a snippet if true.
|
|
1834
1840
|
*/
|
|
@@ -10480,6 +10486,7 @@ declare namespace ts {
|
|
|
10480
10486
|
renameFilename?: string;
|
|
10481
10487
|
renameLocation?: number;
|
|
10482
10488
|
commands?: CodeActionCommand[];
|
|
10489
|
+
notApplicableReason?: string;
|
|
10483
10490
|
}
|
|
10484
10491
|
type RefactorTriggerReason = "implicit" | "invoked";
|
|
10485
10492
|
interface TextInsertion {
|
|
@@ -10801,6 +10808,7 @@ declare namespace ts {
|
|
|
10801
10808
|
kindModifiers?: string;
|
|
10802
10809
|
sortText: string;
|
|
10803
10810
|
insertText?: string;
|
|
10811
|
+
filterText?: string;
|
|
10804
10812
|
isSnippet?: true;
|
|
10805
10813
|
/**
|
|
10806
10814
|
* An optional span that indicates the text to be replaced by this completion item.
|
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-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230518`;
|
|
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?"),
|
|
@@ -20592,7 +20593,8 @@ ${lanes.join("\n")}
|
|
|
20592
20593
|
ensureUseStrict,
|
|
20593
20594
|
liftToBlock,
|
|
20594
20595
|
mergeLexicalEnvironment,
|
|
20595
|
-
updateModifiers
|
|
20596
|
+
updateModifiers,
|
|
20597
|
+
updateModifierLike
|
|
20596
20598
|
};
|
|
20597
20599
|
forEach(nodeFactoryPatchers, (fn) => fn(factory2));
|
|
20598
20600
|
return factory2;
|
|
@@ -24074,6 +24076,9 @@ ${lanes.join("\n")}
|
|
|
24074
24076
|
}
|
|
24075
24077
|
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
|
|
24076
24078
|
}
|
|
24079
|
+
function updateModifierLike(node, modifierArray) {
|
|
24080
|
+
return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
|
|
24081
|
+
}
|
|
24077
24082
|
function asNodeArray(array) {
|
|
24078
24083
|
return array ? createNodeArray(array) : void 0;
|
|
24079
24084
|
}
|
|
@@ -25516,10 +25521,10 @@ ${lanes.join("\n")}
|
|
|
25516
25521
|
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
25517
25522
|
if (_ = accept(result.get)) descriptor.get = _;
|
|
25518
25523
|
if (_ = accept(result.set)) descriptor.set = _;
|
|
25519
|
-
if (_ = accept(result.init)) initializers.
|
|
25524
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
25520
25525
|
}
|
|
25521
25526
|
else if (_ = accept(result)) {
|
|
25522
|
-
if (kind === "field") initializers.
|
|
25527
|
+
if (kind === "field") initializers.unshift(_);
|
|
25523
25528
|
else descriptor[key] = _;
|
|
25524
25529
|
}
|
|
25525
25530
|
}
|
|
@@ -72113,7 +72118,7 @@ ${lanes.join("\n")}
|
|
|
72113
72118
|
}
|
|
72114
72119
|
const typeArgument = typeArgumentTypes[i];
|
|
72115
72120
|
if (!checkTypeAssignableTo(
|
|
72116
|
-
|
|
72121
|
+
typeArgument,
|
|
72117
72122
|
getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument),
|
|
72118
72123
|
reportErrors2 ? typeArgumentNodes[i] : void 0,
|
|
72119
72124
|
typeArgumentHeadMessage,
|
|
@@ -121826,7 +121831,7 @@ ${lanes.join("\n")}
|
|
|
121826
121831
|
let filesWithChangedSetOfUnresolvedImports;
|
|
121827
121832
|
let filesWithInvalidatedResolutions;
|
|
121828
121833
|
let filesWithInvalidatedNonRelativeUnresolvedImports;
|
|
121829
|
-
const nonRelativeExternalModuleResolutions =
|
|
121834
|
+
const nonRelativeExternalModuleResolutions = /* @__PURE__ */ new Set();
|
|
121830
121835
|
const resolutionsWithFailedLookups = /* @__PURE__ */ new Set();
|
|
121831
121836
|
const resolutionsWithOnlyAffectingLocations = /* @__PURE__ */ new Set();
|
|
121832
121837
|
const resolvedFileToResolution = /* @__PURE__ */ new Map();
|
|
@@ -121960,8 +121965,7 @@ ${lanes.join("\n")}
|
|
|
121960
121965
|
moduleResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
121961
121966
|
typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
121962
121967
|
libraryResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
121963
|
-
|
|
121964
|
-
nonRelativeExternalModuleResolutions.clear();
|
|
121968
|
+
watchFailedLookupLocationOfNonRelativeModuleResolutions();
|
|
121965
121969
|
}
|
|
121966
121970
|
function cleanupLibResolutionWatching(newProgram) {
|
|
121967
121971
|
resolvedLibraries.forEach((resolution, libFileName) => {
|
|
@@ -121979,8 +121983,7 @@ ${lanes.join("\n")}
|
|
|
121979
121983
|
function finishCachingPerDirectoryResolution(newProgram, oldProgram) {
|
|
121980
121984
|
filesWithInvalidatedNonRelativeUnresolvedImports = void 0;
|
|
121981
121985
|
allModuleAndTypeResolutionsAreInvalidated = false;
|
|
121982
|
-
|
|
121983
|
-
nonRelativeExternalModuleResolutions.clear();
|
|
121986
|
+
watchFailedLookupLocationOfNonRelativeModuleResolutions();
|
|
121984
121987
|
if (newProgram !== oldProgram) {
|
|
121985
121988
|
cleanupLibResolutionWatching(newProgram);
|
|
121986
121989
|
newProgram == null ? void 0 : newProgram.getSourceFiles().forEach((newFile) => {
|
|
@@ -122261,7 +122264,7 @@ ${lanes.join("\n")}
|
|
|
122261
122264
|
if (!deferWatchingNonRelativeResolution || isExternalModuleNameRelative(name)) {
|
|
122262
122265
|
watchFailedLookupLocationOfResolution(resolution);
|
|
122263
122266
|
} else {
|
|
122264
|
-
nonRelativeExternalModuleResolutions.add(
|
|
122267
|
+
nonRelativeExternalModuleResolutions.add(resolution);
|
|
122265
122268
|
}
|
|
122266
122269
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
122267
122270
|
if (resolved && resolved.resolvedFileName) {
|
|
@@ -122391,17 +122394,9 @@ ${lanes.join("\n")}
|
|
|
122391
122394
|
paths.add(affectingLocation);
|
|
122392
122395
|
}
|
|
122393
122396
|
}
|
|
122394
|
-
function watchFailedLookupLocationOfNonRelativeModuleResolutions(
|
|
122395
|
-
|
|
122396
|
-
|
|
122397
|
-
resolutions.forEach(watchFailedLookupLocationOfResolution);
|
|
122398
|
-
} else {
|
|
122399
|
-
resolutions.forEach((resolution) => watchAffectingLocationsOfResolution(
|
|
122400
|
-
resolution,
|
|
122401
|
-
/*addToResolutionsWithOnlyAffectingLocations*/
|
|
122402
|
-
true
|
|
122403
|
-
));
|
|
122404
|
-
}
|
|
122397
|
+
function watchFailedLookupLocationOfNonRelativeModuleResolutions() {
|
|
122398
|
+
nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfResolution);
|
|
122399
|
+
nonRelativeExternalModuleResolutions.clear();
|
|
122405
122400
|
}
|
|
122406
122401
|
function setDirectoryWatcher(dir, dirPath, nonRecursive) {
|
|
122407
122402
|
const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
|
@@ -135737,8 +135732,12 @@ ${lanes.join("\n")}
|
|
|
135737
135732
|
Debug.assert(actionName2 === refactorNameForMoveToFile, "Wrong refactor invoked");
|
|
135738
135733
|
const statements = Debug.checkDefined(getStatementsToMove(context));
|
|
135739
135734
|
Debug.assert(interactiveRefactorArguments, "No interactive refactor arguments available");
|
|
135740
|
-
const
|
|
135741
|
-
|
|
135735
|
+
const targetFile = interactiveRefactorArguments.targetFile;
|
|
135736
|
+
if (hasJSFileExtension(targetFile) || hasTSFileExtension(targetFile)) {
|
|
135737
|
+
const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(context, context.file, interactiveRefactorArguments.targetFile, context.program, statements, t, context.host, context.preferences));
|
|
135738
|
+
return { edits, renameFilename: void 0, renameLocation: void 0 };
|
|
135739
|
+
}
|
|
135740
|
+
return { edits: [], renameFilename: void 0, renameLocation: void 0, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Cannot_move_to_file_selected_file_is_invalid) };
|
|
135742
135741
|
}
|
|
135743
135742
|
});
|
|
135744
135743
|
}
|
|
@@ -152220,7 +152219,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
152220
152219
|
false
|
|
152221
152220
|
);
|
|
152222
152221
|
const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
|
|
152223
|
-
let modifierFlags = effectiveModifierFlags &
|
|
152222
|
+
let modifierFlags = effectiveModifierFlags & 32 /* Static */;
|
|
152223
|
+
modifierFlags |= effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
|
|
152224
152224
|
if (declaration && isAutoAccessorPropertyDeclaration(declaration)) {
|
|
152225
152225
|
modifierFlags |= 128 /* Accessor */;
|
|
152226
152226
|
}
|
|
@@ -154977,6 +154977,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
154977
154977
|
}
|
|
154978
154978
|
function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) {
|
|
154979
154979
|
let insertText;
|
|
154980
|
+
let filterText;
|
|
154980
154981
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
154981
154982
|
let data;
|
|
154982
154983
|
let isSnippet;
|
|
@@ -155035,11 +155036,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155035
155036
|
}
|
|
155036
155037
|
if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
155037
155038
|
let importAdder;
|
|
155038
|
-
|
|
155039
|
-
|
|
155040
|
-
|
|
155041
|
-
|
|
155042
|
-
|
|
155039
|
+
const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
|
|
155040
|
+
if (memberCompletionEntry) {
|
|
155041
|
+
({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
|
|
155042
|
+
if (importAdder == null ? void 0 : importAdder.hasFixes()) {
|
|
155043
|
+
hasAction = true;
|
|
155044
|
+
source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
|
|
155045
|
+
}
|
|
155046
|
+
} else {
|
|
155047
|
+
return void 0;
|
|
155043
155048
|
}
|
|
155044
155049
|
}
|
|
155045
155050
|
if (origin && originIsObjectLiteralMethod(origin)) {
|
|
@@ -155083,6 +155088,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155083
155088
|
hasAction: hasAction ? true : void 0,
|
|
155084
155089
|
isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0,
|
|
155085
155090
|
insertText,
|
|
155091
|
+
filterText,
|
|
155086
155092
|
replacementSpan,
|
|
155087
155093
|
sourceDisplay,
|
|
155088
155094
|
labelDetails,
|
|
@@ -155103,11 +155109,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155103
155109
|
function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) {
|
|
155104
155110
|
const classLikeDeclaration = findAncestor(location, isClassLike);
|
|
155105
155111
|
if (!classLikeDeclaration) {
|
|
155106
|
-
return
|
|
155112
|
+
return void 0;
|
|
155107
155113
|
}
|
|
155108
155114
|
let isSnippet;
|
|
155109
|
-
let replacementSpan;
|
|
155110
155115
|
let insertText = name;
|
|
155116
|
+
const filterText = name;
|
|
155111
155117
|
const checker = program.getTypeChecker();
|
|
155112
155118
|
const sourceFile = location.getSourceFile();
|
|
155113
155119
|
const printer = createSnippetPrinter({
|
|
@@ -155136,9 +155142,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155136
155142
|
);
|
|
155137
155143
|
}
|
|
155138
155144
|
let modifiers = 0 /* None */;
|
|
155139
|
-
const { modifiers: presentModifiers,
|
|
155140
|
-
const isAbstract =
|
|
155141
|
-
|
|
155145
|
+
const { modifiers: presentModifiers, range: eraseRange, decorators: presentDecorators } = getPresentModifiers(contextToken, sourceFile, position);
|
|
155146
|
+
const isAbstract = presentModifiers & 256 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 256 /* Abstract */;
|
|
155147
|
+
let completionNodes = [];
|
|
155142
155148
|
ts_codefix_exports.addNewNodeForMemberSymbol(
|
|
155143
155149
|
symbol,
|
|
155144
155150
|
classLikeDeclaration,
|
|
@@ -155162,18 +155168,42 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155162
155168
|
requiredModifiers |= 16384 /* Override */;
|
|
155163
155169
|
}
|
|
155164
155170
|
if (!completionNodes.length) {
|
|
155165
|
-
modifiers = node.modifierFlagsCache | requiredModifiers
|
|
155171
|
+
modifiers = node.modifierFlagsCache | requiredModifiers;
|
|
155166
155172
|
}
|
|
155167
155173
|
node = factory.updateModifiers(node, modifiers);
|
|
155168
155174
|
completionNodes.push(node);
|
|
155169
155175
|
},
|
|
155170
155176
|
body,
|
|
155171
155177
|
ts_codefix_exports.PreserveOptionalFlags.Property,
|
|
155172
|
-
isAbstract
|
|
155178
|
+
!!isAbstract
|
|
155173
155179
|
);
|
|
155174
155180
|
if (completionNodes.length) {
|
|
155181
|
+
const isMethod = symbol.flags & 8192 /* Method */;
|
|
155182
|
+
let allowedModifiers = modifiers | 16384 /* Override */ | 4 /* Public */;
|
|
155183
|
+
if (!isMethod) {
|
|
155184
|
+
allowedModifiers |= 2 /* Ambient */ | 64 /* Readonly */;
|
|
155185
|
+
} else {
|
|
155186
|
+
allowedModifiers |= 512 /* Async */;
|
|
155187
|
+
}
|
|
155188
|
+
const allowedAndPresent = presentModifiers & allowedModifiers;
|
|
155189
|
+
if (presentModifiers & ~allowedModifiers) {
|
|
155190
|
+
return void 0;
|
|
155191
|
+
}
|
|
155192
|
+
if (modifiers & 16 /* Protected */ && allowedAndPresent & 4 /* Public */) {
|
|
155193
|
+
modifiers &= ~16 /* Protected */;
|
|
155194
|
+
}
|
|
155195
|
+
if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 4 /* Public */)) {
|
|
155196
|
+
modifiers &= ~4 /* Public */;
|
|
155197
|
+
}
|
|
155198
|
+
modifiers |= allowedAndPresent;
|
|
155199
|
+
completionNodes = completionNodes.map((node) => factory.updateModifiers(node, modifiers));
|
|
155200
|
+
if (presentDecorators == null ? void 0 : presentDecorators.length) {
|
|
155201
|
+
const lastNode = completionNodes[completionNodes.length - 1];
|
|
155202
|
+
if (canHaveDecorators(lastNode)) {
|
|
155203
|
+
completionNodes[completionNodes.length - 1] = factory.updateModifierLike(lastNode, presentDecorators.concat(getModifiers(lastNode) || []));
|
|
155204
|
+
}
|
|
155205
|
+
}
|
|
155175
155206
|
const format = 1 /* MultiLine */ | 131072 /* NoTrailingNewLine */;
|
|
155176
|
-
replacementSpan = modifiersSpan;
|
|
155177
155207
|
if (formatContext) {
|
|
155178
155208
|
insertText = printer.printAndFormatSnippetList(
|
|
155179
155209
|
format,
|
|
@@ -155189,24 +155219,29 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155189
155219
|
);
|
|
155190
155220
|
}
|
|
155191
155221
|
}
|
|
155192
|
-
return { insertText, isSnippet, importAdder,
|
|
155222
|
+
return { insertText, filterText, isSnippet, importAdder, eraseRange };
|
|
155193
155223
|
}
|
|
155194
155224
|
function getPresentModifiers(contextToken, sourceFile, position) {
|
|
155195
155225
|
if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) {
|
|
155196
155226
|
return { modifiers: 0 /* None */ };
|
|
155197
155227
|
}
|
|
155198
155228
|
let modifiers = 0 /* None */;
|
|
155199
|
-
let
|
|
155229
|
+
let decorators;
|
|
155200
155230
|
let contextMod;
|
|
155201
|
-
|
|
155202
|
-
|
|
155203
|
-
span = createTextSpanFromNode(contextToken);
|
|
155204
|
-
}
|
|
155205
|
-
if (isPropertyDeclaration(contextToken.parent)) {
|
|
155231
|
+
const range = { pos: position, end: position };
|
|
155232
|
+
if (isPropertyDeclaration(contextToken.parent) && contextToken.parent.modifiers) {
|
|
155206
155233
|
modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 126975 /* Modifier */;
|
|
155207
|
-
|
|
155234
|
+
decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
|
|
155235
|
+
range.pos = Math.min(range.pos, contextToken.parent.modifiers.pos);
|
|
155236
|
+
}
|
|
155237
|
+
if (contextMod = isModifierLike2(contextToken)) {
|
|
155238
|
+
const contextModifierFlag = modifierToFlag(contextMod);
|
|
155239
|
+
if (!(modifiers & contextModifierFlag)) {
|
|
155240
|
+
modifiers |= contextModifierFlag;
|
|
155241
|
+
range.pos = Math.min(range.pos, contextToken.pos);
|
|
155242
|
+
}
|
|
155208
155243
|
}
|
|
155209
|
-
return { modifiers,
|
|
155244
|
+
return { modifiers, decorators, range: range.pos !== position ? range : void 0 };
|
|
155210
155245
|
}
|
|
155211
155246
|
function isModifierLike2(node) {
|
|
155212
155247
|
if (isModifier(node)) {
|
|
@@ -155829,7 +155864,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155829
155864
|
}
|
|
155830
155865
|
}
|
|
155831
155866
|
if (source === "ClassMemberSnippet/" /* ClassMemberSnippet */) {
|
|
155832
|
-
const { importAdder } = getEntryForMemberCompletion(
|
|
155867
|
+
const { importAdder, eraseRange } = getEntryForMemberCompletion(
|
|
155833
155868
|
host,
|
|
155834
155869
|
program,
|
|
155835
155870
|
compilerOptions,
|
|
@@ -155841,10 +155876,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155841
155876
|
contextToken,
|
|
155842
155877
|
formatContext
|
|
155843
155878
|
);
|
|
155844
|
-
if (importAdder) {
|
|
155879
|
+
if (importAdder || eraseRange) {
|
|
155845
155880
|
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
155846
155881
|
{ host, formatContext, preferences },
|
|
155847
|
-
|
|
155882
|
+
(tracker) => {
|
|
155883
|
+
if (importAdder) {
|
|
155884
|
+
importAdder.writeFixes(tracker);
|
|
155885
|
+
}
|
|
155886
|
+
if (eraseRange) {
|
|
155887
|
+
tracker.deleteRange(sourceFile, eraseRange);
|
|
155888
|
+
}
|
|
155889
|
+
}
|
|
155848
155890
|
);
|
|
155849
155891
|
return {
|
|
155850
155892
|
sourceDisplay: void 0,
|
|
@@ -179117,6 +179159,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
179117
179159
|
kindModifiers,
|
|
179118
179160
|
sortText,
|
|
179119
179161
|
insertText,
|
|
179162
|
+
filterText,
|
|
179120
179163
|
replacementSpan,
|
|
179121
179164
|
hasAction,
|
|
179122
179165
|
source,
|
|
@@ -179135,6 +179178,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
179135
179178
|
kindModifiers,
|
|
179136
179179
|
sortText,
|
|
179137
179180
|
insertText,
|
|
179181
|
+
filterText,
|
|
179138
179182
|
replacementSpan: convertedSpan,
|
|
179139
179183
|
isSnippet,
|
|
179140
179184
|
hasAction: hasAction || void 0,
|
|
@@ -179506,7 +179550,8 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
179506
179550
|
return {
|
|
179507
179551
|
renameLocation: mappedRenameLocation,
|
|
179508
179552
|
renameFilename,
|
|
179509
|
-
edits: this.mapTextChangesToCodeEdits(edits)
|
|
179553
|
+
edits: this.mapTextChangesToCodeEdits(edits),
|
|
179554
|
+
notApplicableReason: result.notApplicableReason
|
|
179510
179555
|
};
|
|
179511
179556
|
}
|
|
179512
179557
|
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 {
|
|
@@ -6838,6 +6839,7 @@ declare namespace ts {
|
|
|
6838
6839
|
kindModifiers?: string;
|
|
6839
6840
|
sortText: string;
|
|
6840
6841
|
insertText?: string;
|
|
6842
|
+
filterText?: string;
|
|
6841
6843
|
isSnippet?: true;
|
|
6842
6844
|
/**
|
|
6843
6845
|
* An optional span that indicates the text to be replaced by this completion item.
|
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-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230518`;
|
|
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?"),
|
|
@@ -20592,7 +20593,8 @@ ${lanes.join("\n")}
|
|
|
20592
20593
|
ensureUseStrict,
|
|
20593
20594
|
liftToBlock,
|
|
20594
20595
|
mergeLexicalEnvironment,
|
|
20595
|
-
updateModifiers
|
|
20596
|
+
updateModifiers,
|
|
20597
|
+
updateModifierLike
|
|
20596
20598
|
};
|
|
20597
20599
|
forEach(nodeFactoryPatchers, (fn) => fn(factory2));
|
|
20598
20600
|
return factory2;
|
|
@@ -24074,6 +24076,9 @@ ${lanes.join("\n")}
|
|
|
24074
24076
|
}
|
|
24075
24077
|
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
|
|
24076
24078
|
}
|
|
24079
|
+
function updateModifierLike(node, modifierArray) {
|
|
24080
|
+
return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
|
|
24081
|
+
}
|
|
24077
24082
|
function asNodeArray(array) {
|
|
24078
24083
|
return array ? createNodeArray(array) : void 0;
|
|
24079
24084
|
}
|
|
@@ -25516,10 +25521,10 @@ ${lanes.join("\n")}
|
|
|
25516
25521
|
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
25517
25522
|
if (_ = accept(result.get)) descriptor.get = _;
|
|
25518
25523
|
if (_ = accept(result.set)) descriptor.set = _;
|
|
25519
|
-
if (_ = accept(result.init)) initializers.
|
|
25524
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
25520
25525
|
}
|
|
25521
25526
|
else if (_ = accept(result)) {
|
|
25522
|
-
if (kind === "field") initializers.
|
|
25527
|
+
if (kind === "field") initializers.unshift(_);
|
|
25523
25528
|
else descriptor[key] = _;
|
|
25524
25529
|
}
|
|
25525
25530
|
}
|
|
@@ -72113,7 +72118,7 @@ ${lanes.join("\n")}
|
|
|
72113
72118
|
}
|
|
72114
72119
|
const typeArgument = typeArgumentTypes[i];
|
|
72115
72120
|
if (!checkTypeAssignableTo(
|
|
72116
|
-
|
|
72121
|
+
typeArgument,
|
|
72117
72122
|
getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument),
|
|
72118
72123
|
reportErrors2 ? typeArgumentNodes[i] : void 0,
|
|
72119
72124
|
typeArgumentHeadMessage,
|
|
@@ -121826,7 +121831,7 @@ ${lanes.join("\n")}
|
|
|
121826
121831
|
let filesWithChangedSetOfUnresolvedImports;
|
|
121827
121832
|
let filesWithInvalidatedResolutions;
|
|
121828
121833
|
let filesWithInvalidatedNonRelativeUnresolvedImports;
|
|
121829
|
-
const nonRelativeExternalModuleResolutions =
|
|
121834
|
+
const nonRelativeExternalModuleResolutions = /* @__PURE__ */ new Set();
|
|
121830
121835
|
const resolutionsWithFailedLookups = /* @__PURE__ */ new Set();
|
|
121831
121836
|
const resolutionsWithOnlyAffectingLocations = /* @__PURE__ */ new Set();
|
|
121832
121837
|
const resolvedFileToResolution = /* @__PURE__ */ new Map();
|
|
@@ -121960,8 +121965,7 @@ ${lanes.join("\n")}
|
|
|
121960
121965
|
moduleResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
121961
121966
|
typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
121962
121967
|
libraryResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
121963
|
-
|
|
121964
|
-
nonRelativeExternalModuleResolutions.clear();
|
|
121968
|
+
watchFailedLookupLocationOfNonRelativeModuleResolutions();
|
|
121965
121969
|
}
|
|
121966
121970
|
function cleanupLibResolutionWatching(newProgram) {
|
|
121967
121971
|
resolvedLibraries.forEach((resolution, libFileName) => {
|
|
@@ -121979,8 +121983,7 @@ ${lanes.join("\n")}
|
|
|
121979
121983
|
function finishCachingPerDirectoryResolution(newProgram, oldProgram) {
|
|
121980
121984
|
filesWithInvalidatedNonRelativeUnresolvedImports = void 0;
|
|
121981
121985
|
allModuleAndTypeResolutionsAreInvalidated = false;
|
|
121982
|
-
|
|
121983
|
-
nonRelativeExternalModuleResolutions.clear();
|
|
121986
|
+
watchFailedLookupLocationOfNonRelativeModuleResolutions();
|
|
121984
121987
|
if (newProgram !== oldProgram) {
|
|
121985
121988
|
cleanupLibResolutionWatching(newProgram);
|
|
121986
121989
|
newProgram == null ? void 0 : newProgram.getSourceFiles().forEach((newFile) => {
|
|
@@ -122261,7 +122264,7 @@ ${lanes.join("\n")}
|
|
|
122261
122264
|
if (!deferWatchingNonRelativeResolution || isExternalModuleNameRelative(name)) {
|
|
122262
122265
|
watchFailedLookupLocationOfResolution(resolution);
|
|
122263
122266
|
} else {
|
|
122264
|
-
nonRelativeExternalModuleResolutions.add(
|
|
122267
|
+
nonRelativeExternalModuleResolutions.add(resolution);
|
|
122265
122268
|
}
|
|
122266
122269
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
122267
122270
|
if (resolved && resolved.resolvedFileName) {
|
|
@@ -122391,17 +122394,9 @@ ${lanes.join("\n")}
|
|
|
122391
122394
|
paths.add(affectingLocation);
|
|
122392
122395
|
}
|
|
122393
122396
|
}
|
|
122394
|
-
function watchFailedLookupLocationOfNonRelativeModuleResolutions(
|
|
122395
|
-
|
|
122396
|
-
|
|
122397
|
-
resolutions.forEach(watchFailedLookupLocationOfResolution);
|
|
122398
|
-
} else {
|
|
122399
|
-
resolutions.forEach((resolution) => watchAffectingLocationsOfResolution(
|
|
122400
|
-
resolution,
|
|
122401
|
-
/*addToResolutionsWithOnlyAffectingLocations*/
|
|
122402
|
-
true
|
|
122403
|
-
));
|
|
122404
|
-
}
|
|
122397
|
+
function watchFailedLookupLocationOfNonRelativeModuleResolutions() {
|
|
122398
|
+
nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfResolution);
|
|
122399
|
+
nonRelativeExternalModuleResolutions.clear();
|
|
122405
122400
|
}
|
|
122406
122401
|
function setDirectoryWatcher(dir, dirPath, nonRecursive) {
|
|
122407
122402
|
const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
|
@@ -135752,8 +135747,12 @@ ${lanes.join("\n")}
|
|
|
135752
135747
|
Debug.assert(actionName2 === refactorNameForMoveToFile, "Wrong refactor invoked");
|
|
135753
135748
|
const statements = Debug.checkDefined(getStatementsToMove(context));
|
|
135754
135749
|
Debug.assert(interactiveRefactorArguments, "No interactive refactor arguments available");
|
|
135755
|
-
const
|
|
135756
|
-
|
|
135750
|
+
const targetFile = interactiveRefactorArguments.targetFile;
|
|
135751
|
+
if (hasJSFileExtension(targetFile) || hasTSFileExtension(targetFile)) {
|
|
135752
|
+
const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(context, context.file, interactiveRefactorArguments.targetFile, context.program, statements, t, context.host, context.preferences));
|
|
135753
|
+
return { edits, renameFilename: void 0, renameLocation: void 0 };
|
|
135754
|
+
}
|
|
135755
|
+
return { edits: [], renameFilename: void 0, renameLocation: void 0, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Cannot_move_to_file_selected_file_is_invalid) };
|
|
135757
135756
|
}
|
|
135758
135757
|
});
|
|
135759
135758
|
}
|
|
@@ -152235,7 +152234,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
152235
152234
|
false
|
|
152236
152235
|
);
|
|
152237
152236
|
const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
|
|
152238
|
-
let modifierFlags = effectiveModifierFlags &
|
|
152237
|
+
let modifierFlags = effectiveModifierFlags & 32 /* Static */;
|
|
152238
|
+
modifierFlags |= effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
|
|
152239
152239
|
if (declaration && isAutoAccessorPropertyDeclaration(declaration)) {
|
|
152240
152240
|
modifierFlags |= 128 /* Accessor */;
|
|
152241
152241
|
}
|
|
@@ -154992,6 +154992,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
154992
154992
|
}
|
|
154993
154993
|
function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) {
|
|
154994
154994
|
let insertText;
|
|
154995
|
+
let filterText;
|
|
154995
154996
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
154996
154997
|
let data;
|
|
154997
154998
|
let isSnippet;
|
|
@@ -155050,11 +155051,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155050
155051
|
}
|
|
155051
155052
|
if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
155052
155053
|
let importAdder;
|
|
155053
|
-
|
|
155054
|
-
|
|
155055
|
-
|
|
155056
|
-
|
|
155057
|
-
|
|
155054
|
+
const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
|
|
155055
|
+
if (memberCompletionEntry) {
|
|
155056
|
+
({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
|
|
155057
|
+
if (importAdder == null ? void 0 : importAdder.hasFixes()) {
|
|
155058
|
+
hasAction = true;
|
|
155059
|
+
source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
|
|
155060
|
+
}
|
|
155061
|
+
} else {
|
|
155062
|
+
return void 0;
|
|
155058
155063
|
}
|
|
155059
155064
|
}
|
|
155060
155065
|
if (origin && originIsObjectLiteralMethod(origin)) {
|
|
@@ -155098,6 +155103,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155098
155103
|
hasAction: hasAction ? true : void 0,
|
|
155099
155104
|
isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0,
|
|
155100
155105
|
insertText,
|
|
155106
|
+
filterText,
|
|
155101
155107
|
replacementSpan,
|
|
155102
155108
|
sourceDisplay,
|
|
155103
155109
|
labelDetails,
|
|
@@ -155118,11 +155124,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155118
155124
|
function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) {
|
|
155119
155125
|
const classLikeDeclaration = findAncestor(location, isClassLike);
|
|
155120
155126
|
if (!classLikeDeclaration) {
|
|
155121
|
-
return
|
|
155127
|
+
return void 0;
|
|
155122
155128
|
}
|
|
155123
155129
|
let isSnippet;
|
|
155124
|
-
let replacementSpan;
|
|
155125
155130
|
let insertText = name;
|
|
155131
|
+
const filterText = name;
|
|
155126
155132
|
const checker = program.getTypeChecker();
|
|
155127
155133
|
const sourceFile = location.getSourceFile();
|
|
155128
155134
|
const printer = createSnippetPrinter({
|
|
@@ -155151,9 +155157,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155151
155157
|
);
|
|
155152
155158
|
}
|
|
155153
155159
|
let modifiers = 0 /* None */;
|
|
155154
|
-
const { modifiers: presentModifiers,
|
|
155155
|
-
const isAbstract =
|
|
155156
|
-
|
|
155160
|
+
const { modifiers: presentModifiers, range: eraseRange, decorators: presentDecorators } = getPresentModifiers(contextToken, sourceFile, position);
|
|
155161
|
+
const isAbstract = presentModifiers & 256 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 256 /* Abstract */;
|
|
155162
|
+
let completionNodes = [];
|
|
155157
155163
|
ts_codefix_exports.addNewNodeForMemberSymbol(
|
|
155158
155164
|
symbol,
|
|
155159
155165
|
classLikeDeclaration,
|
|
@@ -155177,18 +155183,42 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155177
155183
|
requiredModifiers |= 16384 /* Override */;
|
|
155178
155184
|
}
|
|
155179
155185
|
if (!completionNodes.length) {
|
|
155180
|
-
modifiers = node.modifierFlagsCache | requiredModifiers
|
|
155186
|
+
modifiers = node.modifierFlagsCache | requiredModifiers;
|
|
155181
155187
|
}
|
|
155182
155188
|
node = factory.updateModifiers(node, modifiers);
|
|
155183
155189
|
completionNodes.push(node);
|
|
155184
155190
|
},
|
|
155185
155191
|
body,
|
|
155186
155192
|
ts_codefix_exports.PreserveOptionalFlags.Property,
|
|
155187
|
-
isAbstract
|
|
155193
|
+
!!isAbstract
|
|
155188
155194
|
);
|
|
155189
155195
|
if (completionNodes.length) {
|
|
155196
|
+
const isMethod = symbol.flags & 8192 /* Method */;
|
|
155197
|
+
let allowedModifiers = modifiers | 16384 /* Override */ | 4 /* Public */;
|
|
155198
|
+
if (!isMethod) {
|
|
155199
|
+
allowedModifiers |= 2 /* Ambient */ | 64 /* Readonly */;
|
|
155200
|
+
} else {
|
|
155201
|
+
allowedModifiers |= 512 /* Async */;
|
|
155202
|
+
}
|
|
155203
|
+
const allowedAndPresent = presentModifiers & allowedModifiers;
|
|
155204
|
+
if (presentModifiers & ~allowedModifiers) {
|
|
155205
|
+
return void 0;
|
|
155206
|
+
}
|
|
155207
|
+
if (modifiers & 16 /* Protected */ && allowedAndPresent & 4 /* Public */) {
|
|
155208
|
+
modifiers &= ~16 /* Protected */;
|
|
155209
|
+
}
|
|
155210
|
+
if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 4 /* Public */)) {
|
|
155211
|
+
modifiers &= ~4 /* Public */;
|
|
155212
|
+
}
|
|
155213
|
+
modifiers |= allowedAndPresent;
|
|
155214
|
+
completionNodes = completionNodes.map((node) => factory.updateModifiers(node, modifiers));
|
|
155215
|
+
if (presentDecorators == null ? void 0 : presentDecorators.length) {
|
|
155216
|
+
const lastNode = completionNodes[completionNodes.length - 1];
|
|
155217
|
+
if (canHaveDecorators(lastNode)) {
|
|
155218
|
+
completionNodes[completionNodes.length - 1] = factory.updateModifierLike(lastNode, presentDecorators.concat(getModifiers(lastNode) || []));
|
|
155219
|
+
}
|
|
155220
|
+
}
|
|
155190
155221
|
const format = 1 /* MultiLine */ | 131072 /* NoTrailingNewLine */;
|
|
155191
|
-
replacementSpan = modifiersSpan;
|
|
155192
155222
|
if (formatContext) {
|
|
155193
155223
|
insertText = printer.printAndFormatSnippetList(
|
|
155194
155224
|
format,
|
|
@@ -155204,24 +155234,29 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155204
155234
|
);
|
|
155205
155235
|
}
|
|
155206
155236
|
}
|
|
155207
|
-
return { insertText, isSnippet, importAdder,
|
|
155237
|
+
return { insertText, filterText, isSnippet, importAdder, eraseRange };
|
|
155208
155238
|
}
|
|
155209
155239
|
function getPresentModifiers(contextToken, sourceFile, position) {
|
|
155210
155240
|
if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) {
|
|
155211
155241
|
return { modifiers: 0 /* None */ };
|
|
155212
155242
|
}
|
|
155213
155243
|
let modifiers = 0 /* None */;
|
|
155214
|
-
let
|
|
155244
|
+
let decorators;
|
|
155215
155245
|
let contextMod;
|
|
155216
|
-
|
|
155217
|
-
|
|
155218
|
-
span = createTextSpanFromNode(contextToken);
|
|
155219
|
-
}
|
|
155220
|
-
if (isPropertyDeclaration(contextToken.parent)) {
|
|
155246
|
+
const range = { pos: position, end: position };
|
|
155247
|
+
if (isPropertyDeclaration(contextToken.parent) && contextToken.parent.modifiers) {
|
|
155221
155248
|
modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 126975 /* Modifier */;
|
|
155222
|
-
|
|
155249
|
+
decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
|
|
155250
|
+
range.pos = Math.min(range.pos, contextToken.parent.modifiers.pos);
|
|
155251
|
+
}
|
|
155252
|
+
if (contextMod = isModifierLike2(contextToken)) {
|
|
155253
|
+
const contextModifierFlag = modifierToFlag(contextMod);
|
|
155254
|
+
if (!(modifiers & contextModifierFlag)) {
|
|
155255
|
+
modifiers |= contextModifierFlag;
|
|
155256
|
+
range.pos = Math.min(range.pos, contextToken.pos);
|
|
155257
|
+
}
|
|
155223
155258
|
}
|
|
155224
|
-
return { modifiers,
|
|
155259
|
+
return { modifiers, decorators, range: range.pos !== position ? range : void 0 };
|
|
155225
155260
|
}
|
|
155226
155261
|
function isModifierLike2(node) {
|
|
155227
155262
|
if (isModifier(node)) {
|
|
@@ -155844,7 +155879,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155844
155879
|
}
|
|
155845
155880
|
}
|
|
155846
155881
|
if (source === "ClassMemberSnippet/" /* ClassMemberSnippet */) {
|
|
155847
|
-
const { importAdder } = getEntryForMemberCompletion(
|
|
155882
|
+
const { importAdder, eraseRange } = getEntryForMemberCompletion(
|
|
155848
155883
|
host,
|
|
155849
155884
|
program,
|
|
155850
155885
|
compilerOptions,
|
|
@@ -155856,10 +155891,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155856
155891
|
contextToken,
|
|
155857
155892
|
formatContext
|
|
155858
155893
|
);
|
|
155859
|
-
if (importAdder) {
|
|
155894
|
+
if (importAdder || eraseRange) {
|
|
155860
155895
|
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
155861
155896
|
{ host, formatContext, preferences },
|
|
155862
|
-
|
|
155897
|
+
(tracker) => {
|
|
155898
|
+
if (importAdder) {
|
|
155899
|
+
importAdder.writeFixes(tracker);
|
|
155900
|
+
}
|
|
155901
|
+
if (eraseRange) {
|
|
155902
|
+
tracker.deleteRange(sourceFile, eraseRange);
|
|
155903
|
+
}
|
|
155904
|
+
}
|
|
155863
155905
|
);
|
|
155864
155906
|
return {
|
|
155865
155907
|
sourceDisplay: void 0,
|
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-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20230518`;
|
|
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?"),
|
|
@@ -12891,7 +12892,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
12891
12892
|
ensureUseStrict,
|
|
12892
12893
|
liftToBlock,
|
|
12893
12894
|
mergeLexicalEnvironment,
|
|
12894
|
-
updateModifiers
|
|
12895
|
+
updateModifiers,
|
|
12896
|
+
updateModifierLike
|
|
12895
12897
|
};
|
|
12896
12898
|
forEach(nodeFactoryPatchers, (fn) => fn(factory2));
|
|
12897
12899
|
return factory2;
|
|
@@ -16373,6 +16375,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
16373
16375
|
}
|
|
16374
16376
|
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
|
|
16375
16377
|
}
|
|
16378
|
+
function updateModifierLike(node, modifierArray) {
|
|
16379
|
+
return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
|
|
16380
|
+
}
|
|
16376
16381
|
function asNodeArray(array) {
|
|
16377
16382
|
return array ? createNodeArray(array) : void 0;
|
|
16378
16383
|
}
|
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.2.0-pr-
|
|
5
|
+
"version": "5.2.0-pr-54316-2",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "20.1.0",
|
|
115
115
|
"npm": "8.19.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "a41011714cabdcecddcea48e3f06cf29cb409667"
|
|
118
118
|
}
|