typescript 4.8.0-dev.20220616 → 4.8.0-dev.20220617
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 +53 -11
- package/lib/tsserver.js +157 -49
- package/lib/tsserverlibrary.d.ts +8 -0
- package/lib/tsserverlibrary.js +157 -49
- package/lib/typescript.d.ts +8 -0
- package/lib/typescript.js +125 -27
- package/lib/typescriptServices.d.ts +8 -0
- package/lib/typescriptServices.js +125 -27
- package/lib/typingsInstaller.js +61 -11
- package/package.json +19 -20
package/lib/typescript.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220617";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -9857,6 +9857,8 @@ var ts;
|
|
|
9857
9857
|
Qualified_name_0_is_not_allowed_without_a_leading_param_object_1: diag(8032, ts.DiagnosticCategory.Error, "Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032", "Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."),
|
|
9858
9858
|
A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags: diag(8033, ts.DiagnosticCategory.Error, "A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033", "A JSDoc '@typedef' comment may not contain multiple '@type' tags."),
|
|
9859
9859
|
The_tag_was_first_specified_here: diag(8034, ts.DiagnosticCategory.Error, "The_tag_was_first_specified_here_8034", "The tag was first specified here."),
|
|
9860
|
+
You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."),
|
|
9861
|
+
You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."),
|
|
9860
9862
|
Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, ts.DiagnosticCategory.Error, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),
|
|
9861
9863
|
Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, ts.DiagnosticCategory.Error, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),
|
|
9862
9864
|
JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17000, ts.DiagnosticCategory.Error, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."),
|
|
@@ -49095,9 +49097,9 @@ var ts;
|
|
|
49095
49097
|
return moduleSpecifier && resolveExternalModuleName(moduleSpecifier, moduleSpecifier, /*ignoreErrors*/ true);
|
|
49096
49098
|
},
|
|
49097
49099
|
resolveExternalModuleSymbol: resolveExternalModuleSymbol,
|
|
49098
|
-
tryGetThisTypeAt: function (nodeIn, includeGlobalThis) {
|
|
49100
|
+
tryGetThisTypeAt: function (nodeIn, includeGlobalThis, container) {
|
|
49099
49101
|
var node = ts.getParseTreeNode(nodeIn);
|
|
49100
|
-
return node && tryGetThisTypeAt(node, includeGlobalThis);
|
|
49102
|
+
return node && tryGetThisTypeAt(node, includeGlobalThis, container);
|
|
49101
49103
|
},
|
|
49102
49104
|
getTypeArgumentConstraint: function (nodeIn) {
|
|
49103
49105
|
var node = ts.getParseTreeNode(nodeIn, ts.isTypeNode);
|
|
@@ -59545,7 +59547,7 @@ var ts;
|
|
|
59545
59547
|
}
|
|
59546
59548
|
if (t.flags & 268435456 /* StringMapping */) {
|
|
59547
59549
|
var constraint = getBaseConstraint(t.type);
|
|
59548
|
-
return constraint ? getStringMappingType(t.symbol, constraint) : stringType;
|
|
59550
|
+
return constraint && constraint !== t.type ? getStringMappingType(t.symbol, constraint) : stringType;
|
|
59549
59551
|
}
|
|
59550
59552
|
if (t.flags & 8388608 /* IndexedAccess */) {
|
|
59551
59553
|
if (isMappedTypeGenericIndexedAccess(t)) {
|
|
@@ -62515,9 +62517,12 @@ var ts;
|
|
|
62515
62517
|
}
|
|
62516
62518
|
function getStringMappingType(symbol, type) {
|
|
62517
62519
|
return type.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) :
|
|
62518
|
-
|
|
62519
|
-
|
|
62520
|
-
|
|
62520
|
+
// Mapping<Mapping<T>> === Mapping<T>
|
|
62521
|
+
type.flags & 268435456 /* StringMapping */ && symbol === type.symbol ? type :
|
|
62522
|
+
isGenericIndexType(type) || isPatternLiteralPlaceholderType(type) ? getStringMappingTypeForGenericType(symbol, isPatternLiteralPlaceholderType(type) && !(type.flags & 268435456 /* StringMapping */) ? getTemplateLiteralType(["", ""], [type]) : type) :
|
|
62523
|
+
type.flags & 128 /* StringLiteral */ ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
|
|
62524
|
+
type.flags & 134217728 /* TemplateLiteral */ ? getTemplateLiteralType.apply(void 0, applyTemplateStringMapping(symbol, type.texts, type.types)) :
|
|
62525
|
+
type;
|
|
62521
62526
|
}
|
|
62522
62527
|
function applyStringMapping(symbol, str) {
|
|
62523
62528
|
switch (intrinsicTypeKinds.get(symbol.escapedName)) {
|
|
@@ -62528,6 +62533,15 @@ var ts;
|
|
|
62528
62533
|
}
|
|
62529
62534
|
return str;
|
|
62530
62535
|
}
|
|
62536
|
+
function applyTemplateStringMapping(symbol, texts, types) {
|
|
62537
|
+
switch (intrinsicTypeKinds.get(symbol.escapedName)) {
|
|
62538
|
+
case 0 /* Uppercase */: return [texts.map(function (t) { return t.toUpperCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
|
|
62539
|
+
case 1 /* Lowercase */: return [texts.map(function (t) { return t.toLowerCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
|
|
62540
|
+
case 2 /* Capitalize */: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toUpperCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
|
|
62541
|
+
case 3 /* Uncapitalize */: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toLowerCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
|
|
62542
|
+
}
|
|
62543
|
+
return [texts, types];
|
|
62544
|
+
}
|
|
62531
62545
|
function getStringMappingTypeForGenericType(symbol, type) {
|
|
62532
62546
|
var id = getSymbolId(symbol) + "," + getTypeId(type);
|
|
62533
62547
|
var result = stringMappingTypes.get(id);
|
|
@@ -62769,7 +62783,7 @@ var ts;
|
|
|
62769
62783
|
accessNode;
|
|
62770
62784
|
}
|
|
62771
62785
|
function isPatternLiteralPlaceholderType(type) {
|
|
62772
|
-
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */));
|
|
62786
|
+
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || !!(type.flags & 268435456 /* StringMapping */ && isPatternLiteralPlaceholderType(type.type));
|
|
62773
62787
|
}
|
|
62774
62788
|
function isPatternLiteralType(type) {
|
|
62775
62789
|
return !!(type.flags & 134217728 /* TemplateLiteral */) && ts.every(type.types, isPatternLiteralPlaceholderType);
|
|
@@ -66481,6 +66495,13 @@ var ts;
|
|
|
66481
66495
|
return -1 /* True */;
|
|
66482
66496
|
}
|
|
66483
66497
|
}
|
|
66498
|
+
else if (target.flags & 268435456 /* StringMapping */) {
|
|
66499
|
+
if (!(source.flags & 268435456 /* StringMapping */)) {
|
|
66500
|
+
if (isMemberOfStringMapping(source, target)) {
|
|
66501
|
+
return -1 /* True */;
|
|
66502
|
+
}
|
|
66503
|
+
}
|
|
66504
|
+
}
|
|
66484
66505
|
if (sourceFlags & 8650752 /* TypeVariable */) {
|
|
66485
66506
|
// IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
|
|
66486
66507
|
if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) {
|
|
@@ -66524,7 +66545,10 @@ var ts;
|
|
|
66524
66545
|
}
|
|
66525
66546
|
}
|
|
66526
66547
|
else if (sourceFlags & 268435456 /* StringMapping */) {
|
|
66527
|
-
if (targetFlags & 268435456 /* StringMapping */
|
|
66548
|
+
if (targetFlags & 268435456 /* StringMapping */) {
|
|
66549
|
+
if (source.symbol !== target.symbol) {
|
|
66550
|
+
return 0 /* False */;
|
|
66551
|
+
}
|
|
66528
66552
|
if (result = isRelatedTo(source.type, target.type, 3 /* Both */, reportErrors)) {
|
|
66529
66553
|
resetErrorInfo(saveErrorInfo);
|
|
66530
66554
|
return result;
|
|
@@ -67449,7 +67473,7 @@ var ts;
|
|
|
67449
67473
|
return typeCouldHaveTopLevelSingletonTypes(constraint);
|
|
67450
67474
|
}
|
|
67451
67475
|
}
|
|
67452
|
-
return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */);
|
|
67476
|
+
return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */) || !!(type.flags & 268435456 /* StringMapping */);
|
|
67453
67477
|
}
|
|
67454
67478
|
function getExactOptionalUnassignableProperties(source, target) {
|
|
67455
67479
|
if (isTupleType(source) && isTupleType(target))
|
|
@@ -68920,6 +68944,31 @@ var ts;
|
|
|
68920
68944
|
return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === (s.length + 1) && !(flags & 512 /* ContainsSeparator */)
|
|
68921
68945
|
&& (!roundTripOnly || s === ts.pseudoBigIntToString({ negative: negative, base10Value: ts.parsePseudoBigInt(scanner.getTokenValue()) }));
|
|
68922
68946
|
}
|
|
68947
|
+
function isMemberOfStringMapping(source, target) {
|
|
68948
|
+
if (target.flags & (4 /* String */ | 3 /* AnyOrUnknown */)) {
|
|
68949
|
+
return true;
|
|
68950
|
+
}
|
|
68951
|
+
if (target.flags & 134217728 /* TemplateLiteral */) {
|
|
68952
|
+
return isTypeAssignableTo(source, target);
|
|
68953
|
+
}
|
|
68954
|
+
if (target.flags & 268435456 /* StringMapping */) {
|
|
68955
|
+
// We need to see whether applying the same mappings of the target
|
|
68956
|
+
// onto the source would produce an identical type *and* that
|
|
68957
|
+
// it's compatible with the inner-most non-string-mapped type.
|
|
68958
|
+
//
|
|
68959
|
+
// The intuition here is that if same mappings don't affect the source at all,
|
|
68960
|
+
// and the source is compatible with the unmapped target, then they must
|
|
68961
|
+
// still reside in the same domain.
|
|
68962
|
+
var mappingStack = [];
|
|
68963
|
+
while (target.flags & 268435456 /* StringMapping */) {
|
|
68964
|
+
mappingStack.unshift(target.symbol);
|
|
68965
|
+
target = target.type;
|
|
68966
|
+
}
|
|
68967
|
+
var mappedSource = ts.reduceLeft(mappingStack, function (memo, value) { return getStringMappingType(value, memo); }, source);
|
|
68968
|
+
return mappedSource === source && isMemberOfStringMapping(source, target);
|
|
68969
|
+
}
|
|
68970
|
+
return false;
|
|
68971
|
+
}
|
|
68923
68972
|
function isValidTypeForTemplateLiteralPlaceholder(source, target) {
|
|
68924
68973
|
if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
|
|
68925
68974
|
return true;
|
|
@@ -68928,7 +68977,8 @@ var ts;
|
|
|
68928
68977
|
var value = source.value;
|
|
68929
68978
|
return !!(target.flags & 8 /* Number */ && isValidNumberString(value, /*roundTripOnly*/ false) ||
|
|
68930
68979
|
target.flags & 64 /* BigInt */ && isValidBigIntString(value, /*roundTripOnly*/ false) ||
|
|
68931
|
-
target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName
|
|
68980
|
+
target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName ||
|
|
68981
|
+
target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target));
|
|
68932
68982
|
}
|
|
68933
68983
|
if (source.flags & 134217728 /* TemplateLiteral */) {
|
|
68934
68984
|
var texts = source.texts;
|
|
@@ -135386,7 +135436,7 @@ var ts;
|
|
|
135386
135436
|
}
|
|
135387
135437
|
// Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions`
|
|
135388
135438
|
if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 305 /* SourceFile */) {
|
|
135389
|
-
var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false);
|
|
135439
|
+
var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false, ts.isClassLike(scopeNode.parent) ? scopeNode : undefined);
|
|
135390
135440
|
if (thisType && !isProbablyGlobalType(thisType, sourceFile, typeChecker)) {
|
|
135391
135441
|
for (var _i = 0, _a = getPropertiesForCompletion(thisType, typeChecker); _i < _a.length; _i++) {
|
|
135392
135442
|
var symbol = _a[_i];
|
|
@@ -144724,10 +144774,10 @@ var ts;
|
|
|
144724
144774
|
(function (ts) {
|
|
144725
144775
|
var Rename;
|
|
144726
144776
|
(function (Rename) {
|
|
144727
|
-
function getRenameInfo(program, sourceFile, position,
|
|
144777
|
+
function getRenameInfo(program, sourceFile, position, preferences) {
|
|
144728
144778
|
var node = ts.getAdjustedRenameLocation(ts.getTouchingPropertyName(sourceFile, position));
|
|
144729
144779
|
if (nodeIsEligibleForRename(node)) {
|
|
144730
|
-
var renameInfo = getRenameInfoForNode(node, program.getTypeChecker(), sourceFile, program,
|
|
144780
|
+
var renameInfo = getRenameInfoForNode(node, program.getTypeChecker(), sourceFile, program, preferences);
|
|
144731
144781
|
if (renameInfo) {
|
|
144732
144782
|
return renameInfo;
|
|
144733
144783
|
}
|
|
@@ -144735,7 +144785,7 @@ var ts;
|
|
|
144735
144785
|
return getRenameInfoError(ts.Diagnostics.You_cannot_rename_this_element);
|
|
144736
144786
|
}
|
|
144737
144787
|
Rename.getRenameInfo = getRenameInfo;
|
|
144738
|
-
function getRenameInfoForNode(node, typeChecker, sourceFile, program,
|
|
144788
|
+
function getRenameInfoForNode(node, typeChecker, sourceFile, program, preferences) {
|
|
144739
144789
|
var symbol = typeChecker.getSymbolAtLocation(node);
|
|
144740
144790
|
if (!symbol) {
|
|
144741
144791
|
if (ts.isStringLiteralLike(node)) {
|
|
@@ -144763,7 +144813,12 @@ var ts;
|
|
|
144763
144813
|
return undefined;
|
|
144764
144814
|
}
|
|
144765
144815
|
if (ts.isStringLiteralLike(node) && ts.tryGetImportFromModuleSpecifier(node)) {
|
|
144766
|
-
return
|
|
144816
|
+
return preferences.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined;
|
|
144817
|
+
}
|
|
144818
|
+
// Disallow rename for elements that would rename across `*/node_modules/*` packages.
|
|
144819
|
+
var wouldRenameNodeModules = wouldRenameInOtherNodeModules(sourceFile, symbol, typeChecker, preferences);
|
|
144820
|
+
if (wouldRenameNodeModules) {
|
|
144821
|
+
return getRenameInfoError(wouldRenameNodeModules);
|
|
144767
144822
|
}
|
|
144768
144823
|
var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node);
|
|
144769
144824
|
var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 162 /* ComputedPropertyName */)
|
|
@@ -144777,6 +144832,49 @@ var ts;
|
|
|
144777
144832
|
var sourceFile = declaration.getSourceFile();
|
|
144778
144833
|
return program.isSourceFileDefaultLibrary(sourceFile) && ts.fileExtensionIs(sourceFile.fileName, ".d.ts" /* Dts */);
|
|
144779
144834
|
}
|
|
144835
|
+
function wouldRenameInOtherNodeModules(originalFile, symbol, checker, preferences) {
|
|
144836
|
+
if (!preferences.providePrefixAndSuffixTextForRename && symbol.flags & 2097152 /* Alias */) {
|
|
144837
|
+
var importSpecifier = symbol.declarations && ts.find(symbol.declarations, function (decl) { return ts.isImportSpecifier(decl); });
|
|
144838
|
+
if (importSpecifier && !importSpecifier.propertyName) {
|
|
144839
|
+
symbol = checker.getAliasedSymbol(symbol);
|
|
144840
|
+
}
|
|
144841
|
+
}
|
|
144842
|
+
var declarations = symbol.declarations;
|
|
144843
|
+
if (!declarations) {
|
|
144844
|
+
return undefined;
|
|
144845
|
+
}
|
|
144846
|
+
var originalPackage = getPackagePathComponents(originalFile.path);
|
|
144847
|
+
if (originalPackage === undefined) { // original source file is not in node_modules
|
|
144848
|
+
if (ts.some(declarations, function (declaration) { return ts.isInsideNodeModules(declaration.getSourceFile().path); })) {
|
|
144849
|
+
return ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder;
|
|
144850
|
+
}
|
|
144851
|
+
else {
|
|
144852
|
+
return undefined;
|
|
144853
|
+
}
|
|
144854
|
+
}
|
|
144855
|
+
// original source file is in node_modules
|
|
144856
|
+
for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) {
|
|
144857
|
+
var declaration = declarations_4[_i];
|
|
144858
|
+
var declPackage = getPackagePathComponents(declaration.getSourceFile().path);
|
|
144859
|
+
if (declPackage) {
|
|
144860
|
+
var length_2 = Math.min(originalPackage.length, declPackage.length);
|
|
144861
|
+
for (var i = 0; i <= length_2; i++) {
|
|
144862
|
+
if (ts.compareStringsCaseSensitive(originalPackage[i], declPackage[i]) !== 0 /* EqualTo */) {
|
|
144863
|
+
return ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder;
|
|
144864
|
+
}
|
|
144865
|
+
}
|
|
144866
|
+
}
|
|
144867
|
+
}
|
|
144868
|
+
return undefined;
|
|
144869
|
+
}
|
|
144870
|
+
function getPackagePathComponents(filePath) {
|
|
144871
|
+
var components = ts.getPathComponents(filePath);
|
|
144872
|
+
var nodeModulesIdx = components.lastIndexOf("node_modules");
|
|
144873
|
+
if (nodeModulesIdx === -1) {
|
|
144874
|
+
return undefined;
|
|
144875
|
+
}
|
|
144876
|
+
return components.slice(0, nodeModulesIdx + 2);
|
|
144877
|
+
}
|
|
144780
144878
|
function getRenameInfoForModule(node, sourceFile, moduleSymbol) {
|
|
144781
144879
|
if (!ts.isExternalModuleNameRelative(node.text)) {
|
|
144782
144880
|
return getRenameInfoError(ts.Diagnostics.You_cannot_rename_a_module_via_a_global_import);
|
|
@@ -161816,11 +161914,11 @@ var ts;
|
|
|
161816
161914
|
}
|
|
161817
161915
|
}
|
|
161818
161916
|
else if (ts.isVariableStatement(node) || ts.isVariableDeclarationList(node)) {
|
|
161819
|
-
var
|
|
161917
|
+
var declarations_6 = ts.isVariableStatement(node) ? node.declarationList.declarations : node.declarations;
|
|
161820
161918
|
var numInitializers = 0;
|
|
161821
161919
|
var lastInitializer = void 0;
|
|
161822
|
-
for (var _i = 0,
|
|
161823
|
-
var declaration =
|
|
161920
|
+
for (var _i = 0, declarations_5 = declarations_6; _i < declarations_5.length; _i++) {
|
|
161921
|
+
var declaration = declarations_5[_i];
|
|
161824
161922
|
if (declaration.initializer) {
|
|
161825
161923
|
numInitializers++;
|
|
161826
161924
|
lastInitializer = declaration.initializer;
|
|
@@ -165957,8 +166055,8 @@ var ts;
|
|
|
165957
166055
|
tags = __spreadArray(__spreadArray([], inheritedTags, true), tags, true);
|
|
165958
166056
|
}
|
|
165959
166057
|
};
|
|
165960
|
-
for (var _i = 0,
|
|
165961
|
-
var declaration =
|
|
166058
|
+
for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) {
|
|
166059
|
+
var declaration = declarations_7[_i];
|
|
165962
166060
|
_loop_21(declaration);
|
|
165963
166061
|
}
|
|
165964
166062
|
}
|
|
@@ -165984,8 +166082,8 @@ var ts;
|
|
|
165984
166082
|
if (inheritedDocs)
|
|
165985
166083
|
doc = doc.length === 0 ? inheritedDocs.slice() : inheritedDocs.concat(ts.lineBreakPart(), doc);
|
|
165986
166084
|
};
|
|
165987
|
-
for (var _i = 0,
|
|
165988
|
-
var declaration =
|
|
166085
|
+
for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {
|
|
166086
|
+
var declaration = declarations_8[_i];
|
|
165989
166087
|
_loop_22(declaration);
|
|
165990
166088
|
}
|
|
165991
166089
|
}
|
|
@@ -167562,9 +167660,9 @@ var ts;
|
|
|
167562
167660
|
return ts.stringContains(path, "/node_modules/");
|
|
167563
167661
|
}
|
|
167564
167662
|
}
|
|
167565
|
-
function getRenameInfo(fileName, position,
|
|
167663
|
+
function getRenameInfo(fileName, position, preferences) {
|
|
167566
167664
|
synchronizeHostData();
|
|
167567
|
-
return ts.Rename.getRenameInfo(program, getValidSourceFile(fileName), position,
|
|
167665
|
+
return ts.Rename.getRenameInfo(program, getValidSourceFile(fileName), position, preferences || {});
|
|
167568
167666
|
}
|
|
167569
167667
|
function getRefactorContext(file, positionOrRange, preferences, formatOptions, triggerReason, kind) {
|
|
167570
167668
|
var _a = typeof positionOrRange === "number" ? [positionOrRange, undefined] : [positionOrRange.pos, positionOrRange.end], startPosition = _a[0], endPosition = _a[1];
|
|
@@ -168930,9 +169028,9 @@ var ts;
|
|
|
168930
169028
|
var _this = this;
|
|
168931
169029
|
return this.forwardJSONCall("getImplementationAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getImplementationAtPosition(fileName, position); });
|
|
168932
169030
|
};
|
|
168933
|
-
LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position,
|
|
169031
|
+
LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position, preferences) {
|
|
168934
169032
|
var _this = this;
|
|
168935
|
-
return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position,
|
|
169033
|
+
return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position, preferences); });
|
|
168936
169034
|
};
|
|
168937
169035
|
LanguageServiceShimObject.prototype.getSmartSelectionRange = function (fileName, position) {
|
|
168938
169036
|
var _this = this;
|
|
@@ -4137,6 +4137,7 @@ declare namespace ts {
|
|
|
4137
4137
|
readonly includeInlayPropertyDeclarationTypeHints?: boolean;
|
|
4138
4138
|
readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
|
|
4139
4139
|
readonly includeInlayEnumMemberValueHints?: boolean;
|
|
4140
|
+
readonly allowRenameOfImportPath?: boolean;
|
|
4140
4141
|
}
|
|
4141
4142
|
/** Represents a bigint literal value without requiring bigint support */
|
|
4142
4143
|
export interface PseudoBigInt {
|
|
@@ -5917,6 +5918,8 @@ declare namespace ts {
|
|
|
5917
5918
|
getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan | undefined;
|
|
5918
5919
|
getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan | undefined;
|
|
5919
5920
|
getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): SignatureHelpItems | undefined;
|
|
5921
|
+
getRenameInfo(fileName: string, position: number, preferences: UserPreferences): RenameInfo;
|
|
5922
|
+
/** @deprecated Use the signature with `UserPreferences` instead. */
|
|
5920
5923
|
getRenameInfo(fileName: string, position: number, options?: RenameInfoOptions): RenameInfo;
|
|
5921
5924
|
findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): readonly RenameLocation[] | undefined;
|
|
5922
5925
|
getSmartSelectionRange(fileName: string, position: number): SelectionRange;
|
|
@@ -6296,6 +6299,7 @@ declare namespace ts {
|
|
|
6296
6299
|
Insert = "insert",
|
|
6297
6300
|
Remove = "remove"
|
|
6298
6301
|
}
|
|
6302
|
+
/** @deprecated - consider using EditorSettings instead */
|
|
6299
6303
|
interface EditorOptions {
|
|
6300
6304
|
BaseIndentSize?: number;
|
|
6301
6305
|
IndentSize: number;
|
|
@@ -6313,6 +6317,7 @@ declare namespace ts {
|
|
|
6313
6317
|
indentStyle?: IndentStyle;
|
|
6314
6318
|
trimTrailingWhitespace?: boolean;
|
|
6315
6319
|
}
|
|
6320
|
+
/** @deprecated - consider using FormatCodeSettings instead */
|
|
6316
6321
|
interface FormatCodeOptions extends EditorOptions {
|
|
6317
6322
|
InsertSpaceAfterCommaDelimiter: boolean;
|
|
6318
6323
|
InsertSpaceAfterSemicolonInForStatements: boolean;
|
|
@@ -6438,6 +6443,9 @@ declare namespace ts {
|
|
|
6438
6443
|
canRename: false;
|
|
6439
6444
|
localizedErrorMessage: string;
|
|
6440
6445
|
}
|
|
6446
|
+
/**
|
|
6447
|
+
* @deprecated Use `UserPreferences` instead.
|
|
6448
|
+
*/
|
|
6441
6449
|
interface RenameInfoOptions {
|
|
6442
6450
|
readonly allowRenameOfImportPath?: boolean;
|
|
6443
6451
|
}
|