typescript 5.0.0-dev.20230123 → 5.0.0-dev.20230126
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 +26 -10
- package/lib/tsserver.js +56 -33
- package/lib/tsserverlibrary.d.ts +1 -1
- package/lib/tsserverlibrary.js +53 -34
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +48 -33
- package/lib/typingsInstaller.js +5655 -8
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.0";
|
|
26
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
26
|
+
var version = `${versionMajorMinor}.0-dev.20230126`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -11724,6 +11724,20 @@ function getScriptTargetFeatures() {
|
|
|
11724
11724
|
BigUint64Array: ["at"],
|
|
11725
11725
|
ObjectConstructor: ["hasOwn"],
|
|
11726
11726
|
Error: ["cause"]
|
|
11727
|
+
},
|
|
11728
|
+
es2023: {
|
|
11729
|
+
Array: ["findLastIndex", "findLast"],
|
|
11730
|
+
Int8Array: ["findLastIndex", "findLast"],
|
|
11731
|
+
Uint8Array: ["findLastIndex", "findLast"],
|
|
11732
|
+
Uint8ClampedArray: ["findLastIndex", "findLast"],
|
|
11733
|
+
Int16Array: ["findLastIndex", "findLast"],
|
|
11734
|
+
Uint16Array: ["findLastIndex", "findLast"],
|
|
11735
|
+
Int32Array: ["findLastIndex", "findLast"],
|
|
11736
|
+
Uint32Array: ["findLastIndex", "findLast"],
|
|
11737
|
+
Float32Array: ["findLastIndex", "findLast"],
|
|
11738
|
+
Float64Array: ["findLastIndex", "findLast"],
|
|
11739
|
+
BigInt64Array: ["findLastIndex", "findLast"],
|
|
11740
|
+
BigUint64Array: ["findLastIndex", "findLast"]
|
|
11727
11741
|
}
|
|
11728
11742
|
};
|
|
11729
11743
|
}
|
|
@@ -46308,7 +46322,7 @@ function createTypeChecker(host) {
|
|
|
46308
46322
|
return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker);
|
|
46309
46323
|
function symbolToStringWorker(writer2) {
|
|
46310
46324
|
const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
|
|
46311
|
-
const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ?
|
|
46325
|
+
const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments();
|
|
46312
46326
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
46313
46327
|
printer.writeNode(
|
|
46314
46328
|
4 /* Unspecified */,
|
|
@@ -46330,7 +46344,7 @@ function createTypeChecker(host) {
|
|
|
46330
46344
|
sigOutput = kind === 1 /* Construct */ ? 177 /* ConstructSignature */ : 176 /* CallSignature */;
|
|
46331
46345
|
}
|
|
46332
46346
|
const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */);
|
|
46333
|
-
const printer =
|
|
46347
|
+
const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon();
|
|
46334
46348
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
46335
46349
|
printer.writeNode(
|
|
46336
46350
|
4 /* Unspecified */,
|
|
@@ -46347,8 +46361,7 @@ function createTypeChecker(host) {
|
|
|
46347
46361
|
const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0));
|
|
46348
46362
|
if (typeNode === void 0)
|
|
46349
46363
|
return Debug.fail("should always get typenode");
|
|
46350
|
-
const
|
|
46351
|
-
const printer = createPrinter(options);
|
|
46364
|
+
const printer = type !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults();
|
|
46352
46365
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
46353
46366
|
printer.writeNode(
|
|
46354
46367
|
4 /* Unspecified */,
|
|
@@ -49699,7 +49712,7 @@ function createTypeChecker(host) {
|
|
|
49699
49712
|
typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)
|
|
49700
49713
|
// TODO: GH#18217
|
|
49701
49714
|
);
|
|
49702
|
-
const printer =
|
|
49715
|
+
const printer = createPrinterWithRemoveComments();
|
|
49703
49716
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
49704
49717
|
printer.writeNode(
|
|
49705
49718
|
4 /* Unspecified */,
|
|
@@ -64727,7 +64740,7 @@ function createTypeChecker(host) {
|
|
|
64727
64740
|
return getNonMissingTypeOfSymbol(symbol);
|
|
64728
64741
|
}
|
|
64729
64742
|
function getControlFlowContainer(node) {
|
|
64730
|
-
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind ===
|
|
64743
|
+
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */);
|
|
64731
64744
|
}
|
|
64732
64745
|
function isSymbolAssigned(symbol) {
|
|
64733
64746
|
if (!symbol.valueDeclaration) {
|
|
@@ -64988,14 +65001,13 @@ function createTypeChecker(host) {
|
|
|
64988
65001
|
const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */;
|
|
64989
65002
|
const declarationContainer = getControlFlowContainer(declaration);
|
|
64990
65003
|
let flowContainer = getControlFlowContainer(node);
|
|
64991
|
-
const isCatch = flowContainer.kind === 295 /* CatchClause */;
|
|
64992
65004
|
const isOuterVariable = flowContainer !== declarationContainer;
|
|
64993
65005
|
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
|
|
64994
65006
|
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
|
|
64995
65007
|
while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
|
|
64996
65008
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
64997
65009
|
}
|
|
64998
|
-
const assumeInitialized = isParameter2 ||
|
|
65010
|
+
const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
|
|
64999
65011
|
const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
|
|
65000
65012
|
const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
|
|
65001
65013
|
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
|
|
@@ -78255,7 +78267,7 @@ function createTypeChecker(host) {
|
|
|
78255
78267
|
if (typeAnnotationNode) {
|
|
78256
78268
|
checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression);
|
|
78257
78269
|
}
|
|
78258
|
-
const isIllegalExportDefaultInCJS = !node.isExportEquals && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */);
|
|
78270
|
+
const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */);
|
|
78259
78271
|
if (node.expression.kind === 79 /* Identifier */) {
|
|
78260
78272
|
const id = node.expression;
|
|
78261
78273
|
const sym = resolveEntityName(
|
|
@@ -106274,6 +106286,10 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
|
|
|
106274
106286
|
);
|
|
106275
106287
|
return outputFiles;
|
|
106276
106288
|
}
|
|
106289
|
+
var createPrinterWithDefaults = memoize(() => createPrinter({}));
|
|
106290
|
+
var createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true }));
|
|
106291
|
+
var createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true }));
|
|
106292
|
+
var createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true }));
|
|
106277
106293
|
function createPrinter(printerOptions = {}, handlers = {}) {
|
|
106278
106294
|
const {
|
|
106279
106295
|
hasGlobalName,
|
package/lib/tsserver.js
CHANGED
|
@@ -429,6 +429,10 @@ __export(server_exports, {
|
|
|
429
429
|
createPatternMatcher: () => createPatternMatcher,
|
|
430
430
|
createPrependNodes: () => createPrependNodes,
|
|
431
431
|
createPrinter: () => createPrinter,
|
|
432
|
+
createPrinterWithDefaults: () => createPrinterWithDefaults,
|
|
433
|
+
createPrinterWithRemoveComments: () => createPrinterWithRemoveComments,
|
|
434
|
+
createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape,
|
|
435
|
+
createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon,
|
|
432
436
|
createProgram: () => createProgram,
|
|
433
437
|
createProgramHost: () => createProgramHost,
|
|
434
438
|
createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral,
|
|
@@ -2373,7 +2377,7 @@ __export(ts_server_exports3, {
|
|
|
2373
2377
|
|
|
2374
2378
|
// src/compiler/corePublic.ts
|
|
2375
2379
|
var versionMajorMinor = "5.0";
|
|
2376
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2380
|
+
var version = `${versionMajorMinor}.0-dev.20230126`;
|
|
2377
2381
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2378
2382
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2379
2383
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -15492,6 +15496,20 @@ function getScriptTargetFeatures() {
|
|
|
15492
15496
|
BigUint64Array: ["at"],
|
|
15493
15497
|
ObjectConstructor: ["hasOwn"],
|
|
15494
15498
|
Error: ["cause"]
|
|
15499
|
+
},
|
|
15500
|
+
es2023: {
|
|
15501
|
+
Array: ["findLastIndex", "findLast"],
|
|
15502
|
+
Int8Array: ["findLastIndex", "findLast"],
|
|
15503
|
+
Uint8Array: ["findLastIndex", "findLast"],
|
|
15504
|
+
Uint8ClampedArray: ["findLastIndex", "findLast"],
|
|
15505
|
+
Int16Array: ["findLastIndex", "findLast"],
|
|
15506
|
+
Uint16Array: ["findLastIndex", "findLast"],
|
|
15507
|
+
Int32Array: ["findLastIndex", "findLast"],
|
|
15508
|
+
Uint32Array: ["findLastIndex", "findLast"],
|
|
15509
|
+
Float32Array: ["findLastIndex", "findLast"],
|
|
15510
|
+
Float64Array: ["findLastIndex", "findLast"],
|
|
15511
|
+
BigInt64Array: ["findLastIndex", "findLast"],
|
|
15512
|
+
BigUint64Array: ["findLastIndex", "findLast"]
|
|
15495
15513
|
}
|
|
15496
15514
|
};
|
|
15497
15515
|
}
|
|
@@ -50977,7 +50995,7 @@ function createTypeChecker(host) {
|
|
|
50977
50995
|
return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker);
|
|
50978
50996
|
function symbolToStringWorker(writer2) {
|
|
50979
50997
|
const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
|
|
50980
|
-
const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ?
|
|
50998
|
+
const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments();
|
|
50981
50999
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
50982
51000
|
printer.writeNode(
|
|
50983
51001
|
4 /* Unspecified */,
|
|
@@ -50999,7 +51017,7 @@ function createTypeChecker(host) {
|
|
|
50999
51017
|
sigOutput = kind === 1 /* Construct */ ? 177 /* ConstructSignature */ : 176 /* CallSignature */;
|
|
51000
51018
|
}
|
|
51001
51019
|
const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */);
|
|
51002
|
-
const printer =
|
|
51020
|
+
const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon();
|
|
51003
51021
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
51004
51022
|
printer.writeNode(
|
|
51005
51023
|
4 /* Unspecified */,
|
|
@@ -51016,8 +51034,7 @@ function createTypeChecker(host) {
|
|
|
51016
51034
|
const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0));
|
|
51017
51035
|
if (typeNode === void 0)
|
|
51018
51036
|
return Debug.fail("should always get typenode");
|
|
51019
|
-
const
|
|
51020
|
-
const printer = createPrinter(options);
|
|
51037
|
+
const printer = type !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults();
|
|
51021
51038
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
51022
51039
|
printer.writeNode(
|
|
51023
51040
|
4 /* Unspecified */,
|
|
@@ -54368,7 +54385,7 @@ function createTypeChecker(host) {
|
|
|
54368
54385
|
typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)
|
|
54369
54386
|
// TODO: GH#18217
|
|
54370
54387
|
);
|
|
54371
|
-
const printer =
|
|
54388
|
+
const printer = createPrinterWithRemoveComments();
|
|
54372
54389
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
54373
54390
|
printer.writeNode(
|
|
54374
54391
|
4 /* Unspecified */,
|
|
@@ -69396,7 +69413,7 @@ function createTypeChecker(host) {
|
|
|
69396
69413
|
return getNonMissingTypeOfSymbol(symbol);
|
|
69397
69414
|
}
|
|
69398
69415
|
function getControlFlowContainer(node) {
|
|
69399
|
-
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind ===
|
|
69416
|
+
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */);
|
|
69400
69417
|
}
|
|
69401
69418
|
function isSymbolAssigned(symbol) {
|
|
69402
69419
|
if (!symbol.valueDeclaration) {
|
|
@@ -69657,14 +69674,13 @@ function createTypeChecker(host) {
|
|
|
69657
69674
|
const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */;
|
|
69658
69675
|
const declarationContainer = getControlFlowContainer(declaration);
|
|
69659
69676
|
let flowContainer = getControlFlowContainer(node);
|
|
69660
|
-
const isCatch = flowContainer.kind === 295 /* CatchClause */;
|
|
69661
69677
|
const isOuterVariable = flowContainer !== declarationContainer;
|
|
69662
69678
|
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
|
|
69663
69679
|
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
|
|
69664
69680
|
while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
|
|
69665
69681
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
69666
69682
|
}
|
|
69667
|
-
const assumeInitialized = isParameter2 ||
|
|
69683
|
+
const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 278 /* ExportSpecifier */) || node.parent.kind === 232 /* NonNullExpression */ || declaration.kind === 257 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */;
|
|
69668
69684
|
const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
|
|
69669
69685
|
const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
|
|
69670
69686
|
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
|
|
@@ -82924,7 +82940,7 @@ function createTypeChecker(host) {
|
|
|
82924
82940
|
if (typeAnnotationNode) {
|
|
82925
82941
|
checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression);
|
|
82926
82942
|
}
|
|
82927
|
-
const isIllegalExportDefaultInCJS = !node.isExportEquals && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */);
|
|
82943
|
+
const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */);
|
|
82928
82944
|
if (node.expression.kind === 79 /* Identifier */) {
|
|
82929
82945
|
const id = node.expression;
|
|
82930
82946
|
const sym = resolveEntityName(
|
|
@@ -111125,6 +111141,10 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
|
|
|
111125
111141
|
);
|
|
111126
111142
|
return outputFiles;
|
|
111127
111143
|
}
|
|
111144
|
+
var createPrinterWithDefaults = memoize(() => createPrinter({}));
|
|
111145
|
+
var createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true }));
|
|
111146
|
+
var createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true }));
|
|
111147
|
+
var createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true }));
|
|
111128
111148
|
function createPrinter(printerOptions = {}, handlers = {}) {
|
|
111129
111149
|
const {
|
|
111130
111150
|
hasGlobalName,
|
|
@@ -126912,6 +126932,10 @@ __export(ts_exports3, {
|
|
|
126912
126932
|
createPatternMatcher: () => createPatternMatcher,
|
|
126913
126933
|
createPrependNodes: () => createPrependNodes,
|
|
126914
126934
|
createPrinter: () => createPrinter,
|
|
126935
|
+
createPrinterWithDefaults: () => createPrinterWithDefaults,
|
|
126936
|
+
createPrinterWithRemoveComments: () => createPrinterWithRemoveComments,
|
|
126937
|
+
createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape,
|
|
126938
|
+
createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon,
|
|
126915
126939
|
createProgram: () => createProgram,
|
|
126916
126940
|
createProgramHost: () => createProgramHost,
|
|
126917
126941
|
createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral,
|
|
@@ -131004,7 +131028,7 @@ function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, f
|
|
|
131004
131028
|
function nodeToDisplayParts(node, enclosingDeclaration) {
|
|
131005
131029
|
const file = enclosingDeclaration.getSourceFile();
|
|
131006
131030
|
return mapToDisplayParts((writer) => {
|
|
131007
|
-
const printer =
|
|
131031
|
+
const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon();
|
|
131008
131032
|
printer.writeNode(4 /* Unspecified */, node, file, writer);
|
|
131009
131033
|
});
|
|
131010
131034
|
}
|
|
@@ -137389,12 +137413,9 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
137389
137413
|
Debug.assertEqual(action.type, "install package");
|
|
137390
137414
|
return host.installPackage ? host.installPackage({ fileName: getPath(action.file), packageName: action.packageName }) : Promise.reject("Host does not implement `installPackage`");
|
|
137391
137415
|
}
|
|
137392
|
-
function getDocCommentTemplateAtPosition2(fileName, position, options) {
|
|
137393
|
-
|
|
137394
|
-
|
|
137395
|
-
/*formatSettings*/
|
|
137396
|
-
void 0
|
|
137397
|
-
), syntaxTreeCache.getCurrentSourceFile(fileName), position, options);
|
|
137416
|
+
function getDocCommentTemplateAtPosition2(fileName, position, options, formatOptions) {
|
|
137417
|
+
const formatSettings = formatOptions ? ts_formatting_exports.getFormatContext(formatOptions, host).options : void 0;
|
|
137418
|
+
return ts_JsDoc_exports.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(host, formatSettings), syntaxTreeCache.getCurrentSourceFile(fileName), position, options);
|
|
137398
137419
|
}
|
|
137399
137420
|
function isValidBraceCompletionAtPosition(fileName, position, openingBrace) {
|
|
137400
137421
|
if (openingBrace === 60 /* lessThan */) {
|
|
@@ -138575,10 +138596,10 @@ var LanguageServiceShimObject = class extends ShimBase {
|
|
|
138575
138596
|
}
|
|
138576
138597
|
);
|
|
138577
138598
|
}
|
|
138578
|
-
getDocCommentTemplateAtPosition(fileName, position, options) {
|
|
138599
|
+
getDocCommentTemplateAtPosition(fileName, position, options, formatOptions) {
|
|
138579
138600
|
return this.forwardJSONCall(
|
|
138580
138601
|
`getDocCommentTemplateAtPosition('${fileName}', ${position})`,
|
|
138581
|
-
() => this.languageService.getDocCommentTemplateAtPosition(fileName, position, options)
|
|
138602
|
+
() => this.languageService.getDocCommentTemplateAtPosition(fileName, position, options, formatOptions)
|
|
138582
138603
|
);
|
|
138583
138604
|
}
|
|
138584
138605
|
/// NAVIGATE TO
|
|
@@ -139470,7 +139491,7 @@ function getCallHierarchyItemName(program, node) {
|
|
|
139470
139491
|
}
|
|
139471
139492
|
}
|
|
139472
139493
|
if (text === void 0) {
|
|
139473
|
-
const printer =
|
|
139494
|
+
const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon();
|
|
139474
139495
|
text = usingSingleLineStringWriter((writer) => printer.writeNode(4 /* Unspecified */, node, node.getSourceFile(), writer));
|
|
139475
139496
|
}
|
|
139476
139497
|
return { text, pos: declName.getStart(), end: declName.getEnd() };
|
|
@@ -146192,7 +146213,7 @@ function getDeleteAction(context, { name, jsDocHost, jsDocParameterTag }) {
|
|
|
146192
146213
|
Diagnostics.Delete_all_unused_param_tags
|
|
146193
146214
|
);
|
|
146194
146215
|
}
|
|
146195
|
-
function getRenameAction(context, { name, signature, jsDocParameterTag }) {
|
|
146216
|
+
function getRenameAction(context, { name, jsDocHost, signature, jsDocParameterTag }) {
|
|
146196
146217
|
if (!length(signature.parameters))
|
|
146197
146218
|
return void 0;
|
|
146198
146219
|
const sourceFile = context.sourceFile;
|
|
@@ -146215,7 +146236,7 @@ function getRenameAction(context, { name, signature, jsDocParameterTag }) {
|
|
|
146215
146236
|
jsDocParameterTag.isNameFirst,
|
|
146216
146237
|
jsDocParameterTag.comment
|
|
146217
146238
|
);
|
|
146218
|
-
const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile,
|
|
146239
|
+
const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile, jsDocHost, map(tags, (t) => t === jsDocParameterTag ? newJSDocParameterTag : t)));
|
|
146219
146240
|
return createCodeFixActionWithoutFixAll(renameUnmatchedParameter, changes, [Diagnostics.Rename_param_tag_name_0_to_1, name.getText(sourceFile), parameterName]);
|
|
146220
146241
|
}
|
|
146221
146242
|
function getInfo10(sourceFile, pos) {
|
|
@@ -157240,8 +157261,7 @@ function provideInlayHints(context) {
|
|
|
157240
157261
|
}
|
|
157241
157262
|
function printTypeInSingleLine(type) {
|
|
157242
157263
|
const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */;
|
|
157243
|
-
const
|
|
157244
|
-
const printer = createPrinter(options);
|
|
157264
|
+
const printer = createPrinterWithRemoveComments();
|
|
157245
157265
|
return usingSingleLineStringWriter((writer) => {
|
|
157246
157266
|
const typeNode = checker.typeToTypeNode(
|
|
157247
157267
|
type,
|
|
@@ -157331,6 +157351,8 @@ var jsDocTagNames = [
|
|
|
157331
157351
|
"lends",
|
|
157332
157352
|
"license",
|
|
157333
157353
|
"link",
|
|
157354
|
+
"linkcode",
|
|
157355
|
+
"linkplain",
|
|
157334
157356
|
"listens",
|
|
157335
157357
|
"member",
|
|
157336
157358
|
"memberof",
|
|
@@ -157343,6 +157365,7 @@ var jsDocTagNames = [
|
|
|
157343
157365
|
"package",
|
|
157344
157366
|
"param",
|
|
157345
157367
|
"private",
|
|
157368
|
+
"prop",
|
|
157346
157369
|
"property",
|
|
157347
157370
|
"protected",
|
|
157348
157371
|
"public",
|
|
@@ -164169,7 +164192,7 @@ function createTypeHelpItems(symbol, { argumentCount, argumentsSpan: applicableS
|
|
|
164169
164192
|
}
|
|
164170
164193
|
function getTypeHelpItem(symbol, typeParameters, checker, enclosingDeclaration, sourceFile) {
|
|
164171
164194
|
const typeSymbolDisplay = symbolToDisplayParts(checker, symbol);
|
|
164172
|
-
const printer =
|
|
164195
|
+
const printer = createPrinterWithRemoveComments();
|
|
164173
164196
|
const parameters = typeParameters.map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer));
|
|
164174
164197
|
const documentation = symbol.getDocumentationComment(checker);
|
|
164175
164198
|
const tags = symbol.getJsDocTags(checker);
|
|
@@ -164213,7 +164236,7 @@ function returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, chec
|
|
|
164213
164236
|
}
|
|
164214
164237
|
function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {
|
|
164215
164238
|
const typeParameters = (candidateSignature.target || candidateSignature).typeParameters;
|
|
164216
|
-
const printer =
|
|
164239
|
+
const printer = createPrinterWithRemoveComments();
|
|
164217
164240
|
const parameters = (typeParameters || emptyArray).map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer));
|
|
164218
164241
|
const thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : [];
|
|
164219
164242
|
return checker.getExpandedParameters(candidateSignature).map((paramList) => {
|
|
@@ -164225,7 +164248,7 @@ function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclara
|
|
|
164225
164248
|
});
|
|
164226
164249
|
}
|
|
164227
164250
|
function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {
|
|
164228
|
-
const printer =
|
|
164251
|
+
const printer = createPrinterWithRemoveComments();
|
|
164229
164252
|
const typeParameterParts = mapToDisplayParts((writer) => {
|
|
164230
164253
|
if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) {
|
|
164231
164254
|
const args = factory.createNodeArray(candidateSignature.typeParameters.map((p) => checker.typeParameterToDeclaration(p, enclosingDeclaration, signatureHelpNodeBuilderFlags)));
|
|
@@ -164600,7 +164623,6 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
|
|
|
164600
164623
|
let hasAddedSymbolInfo = false;
|
|
164601
164624
|
const isThisExpression = location.kind === 108 /* ThisKeyword */ && isInExpressionContext(location) || isThisInTypeQuery(location);
|
|
164602
164625
|
let type;
|
|
164603
|
-
let printer;
|
|
164604
164626
|
let documentationFromAlias;
|
|
164605
164627
|
let tagsFromAlias;
|
|
164606
164628
|
let hasMultipleSignatures = false;
|
|
@@ -164993,10 +165015,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
|
|
|
164993
165015
|
}
|
|
164994
165016
|
return { displayParts, documentation, symbolKind, tags: tags.length === 0 ? void 0 : tags };
|
|
164995
165017
|
function getPrinter() {
|
|
164996
|
-
|
|
164997
|
-
printer = createPrinter({ removeComments: true });
|
|
164998
|
-
}
|
|
164999
|
-
return printer;
|
|
165018
|
+
return createPrinterWithRemoveComments();
|
|
165000
165019
|
}
|
|
165001
165020
|
function prefixNextMeaning() {
|
|
165002
165021
|
if (displayParts.length) {
|
|
@@ -178153,7 +178172,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
178153
178172
|
getDocCommentTemplate(args) {
|
|
178154
178173
|
const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args);
|
|
178155
178174
|
const position = this.getPositionInFile(args, file);
|
|
178156
|
-
return languageService.getDocCommentTemplateAtPosition(file, position, this.getPreferences(file));
|
|
178175
|
+
return languageService.getDocCommentTemplateAtPosition(file, position, this.getPreferences(file), this.getFormatOptions(file));
|
|
178157
178176
|
}
|
|
178158
178177
|
getSpanOfEnclosingComment(args) {
|
|
178159
178178
|
const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args);
|
|
@@ -181076,6 +181095,10 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
181076
181095
|
createPatternMatcher,
|
|
181077
181096
|
createPrependNodes,
|
|
181078
181097
|
createPrinter,
|
|
181098
|
+
createPrinterWithDefaults,
|
|
181099
|
+
createPrinterWithRemoveComments,
|
|
181100
|
+
createPrinterWithRemoveCommentsNeverAsciiEscape,
|
|
181101
|
+
createPrinterWithRemoveCommentsOmitTrailingSemicolon,
|
|
181079
181102
|
createProgram,
|
|
181080
181103
|
createProgramHost,
|
|
181081
181104
|
createPropertyNameNodeForIdentifierOrLiteral,
|
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -9990,7 +9990,7 @@ declare namespace ts {
|
|
|
9990
9990
|
getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
|
|
9991
9991
|
getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
|
|
9992
9992
|
getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
|
|
9993
|
-
getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions): TextInsertion | undefined;
|
|
9993
|
+
getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions, formatOptions?: FormatCodeSettings): TextInsertion | undefined;
|
|
9994
9994
|
isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean;
|
|
9995
9995
|
/**
|
|
9996
9996
|
* This will return a defined result if the position is after the `>` of the opening tag, or somewhere in the text, of a JSXElement with no closing tag.
|