@typescript-deploys/pr-build 5.0.0-pr-52382-14 → 5.0.0-pr-52403-9
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 +7 -11
- package/lib/tsserver.js +19 -30
- package/lib/tsserverlibrary.js +20 -27
- package/lib/typescript.js +20 -23
- package/lib/typingsInstaller.js +0 -5647
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -46308,7 +46308,7 @@ function createTypeChecker(host) {
|
|
|
46308
46308
|
return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker);
|
|
46309
46309
|
function symbolToStringWorker(writer2) {
|
|
46310
46310
|
const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
|
|
46311
|
-
const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ?
|
|
46311
|
+
const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinter({ removeComments: true, neverAsciiEscape: true }) : createPrinter({ removeComments: true });
|
|
46312
46312
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
46313
46313
|
printer.writeNode(
|
|
46314
46314
|
4 /* Unspecified */,
|
|
@@ -46330,7 +46330,7 @@ function createTypeChecker(host) {
|
|
|
46330
46330
|
sigOutput = kind === 1 /* Construct */ ? 177 /* ConstructSignature */ : 176 /* CallSignature */;
|
|
46331
46331
|
}
|
|
46332
46332
|
const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */);
|
|
46333
|
-
const printer =
|
|
46333
|
+
const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
46334
46334
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
46335
46335
|
printer.writeNode(
|
|
46336
46336
|
4 /* Unspecified */,
|
|
@@ -46347,7 +46347,8 @@ function createTypeChecker(host) {
|
|
|
46347
46347
|
const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0));
|
|
46348
46348
|
if (typeNode === void 0)
|
|
46349
46349
|
return Debug.fail("should always get typenode");
|
|
46350
|
-
const
|
|
46350
|
+
const options = { removeComments: type !== unresolvedType };
|
|
46351
|
+
const printer = createPrinter(options);
|
|
46351
46352
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
46352
46353
|
printer.writeNode(
|
|
46353
46354
|
4 /* Unspecified */,
|
|
@@ -49698,7 +49699,7 @@ function createTypeChecker(host) {
|
|
|
49698
49699
|
typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)
|
|
49699
49700
|
// TODO: GH#18217
|
|
49700
49701
|
);
|
|
49701
|
-
const printer =
|
|
49702
|
+
const printer = createPrinter({ removeComments: true });
|
|
49702
49703
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
49703
49704
|
printer.writeNode(
|
|
49704
49705
|
4 /* Unspecified */,
|
|
@@ -64726,7 +64727,7 @@ function createTypeChecker(host) {
|
|
|
64726
64727
|
return getNonMissingTypeOfSymbol(symbol);
|
|
64727
64728
|
}
|
|
64728
64729
|
function getControlFlowContainer(node) {
|
|
64729
|
-
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind ===
|
|
64730
|
+
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */);
|
|
64730
64731
|
}
|
|
64731
64732
|
function isSymbolAssigned(symbol) {
|
|
64732
64733
|
if (!symbol.valueDeclaration) {
|
|
@@ -64987,14 +64988,13 @@ function createTypeChecker(host) {
|
|
|
64987
64988
|
const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */;
|
|
64988
64989
|
const declarationContainer = getControlFlowContainer(declaration);
|
|
64989
64990
|
let flowContainer = getControlFlowContainer(node);
|
|
64990
|
-
const isCatch = flowContainer.kind === 295 /* CatchClause */;
|
|
64991
64991
|
const isOuterVariable = flowContainer !== declarationContainer;
|
|
64992
64992
|
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
|
|
64993
64993
|
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
|
|
64994
64994
|
while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
|
|
64995
64995
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
64996
64996
|
}
|
|
64997
|
-
const assumeInitialized = isParameter2 ||
|
|
64997
|
+
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 */;
|
|
64998
64998
|
const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
|
|
64999
64999
|
const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
|
|
65000
65000
|
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
|
|
@@ -106273,10 +106273,6 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
|
|
|
106273
106273
|
);
|
|
106274
106274
|
return outputFiles;
|
|
106275
106275
|
}
|
|
106276
|
-
var createPrinterWithDefaults = memoize(() => createPrinter({}));
|
|
106277
|
-
var createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true }));
|
|
106278
|
-
var createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true }));
|
|
106279
|
-
var createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true }));
|
|
106280
106276
|
function createPrinter(printerOptions = {}, handlers = {}) {
|
|
106281
106277
|
const {
|
|
106282
106278
|
hasGlobalName,
|
package/lib/tsserver.js
CHANGED
|
@@ -429,10 +429,6 @@ __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,
|
|
436
432
|
createProgram: () => createProgram,
|
|
437
433
|
createProgramHost: () => createProgramHost,
|
|
438
434
|
createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral,
|
|
@@ -50981,7 +50977,7 @@ function createTypeChecker(host) {
|
|
|
50981
50977
|
return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker);
|
|
50982
50978
|
function symbolToStringWorker(writer2) {
|
|
50983
50979
|
const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
|
|
50984
|
-
const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ?
|
|
50980
|
+
const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinter({ removeComments: true, neverAsciiEscape: true }) : createPrinter({ removeComments: true });
|
|
50985
50981
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
50986
50982
|
printer.writeNode(
|
|
50987
50983
|
4 /* Unspecified */,
|
|
@@ -51003,7 +50999,7 @@ function createTypeChecker(host) {
|
|
|
51003
50999
|
sigOutput = kind === 1 /* Construct */ ? 177 /* ConstructSignature */ : 176 /* CallSignature */;
|
|
51004
51000
|
}
|
|
51005
51001
|
const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */);
|
|
51006
|
-
const printer =
|
|
51002
|
+
const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
51007
51003
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
51008
51004
|
printer.writeNode(
|
|
51009
51005
|
4 /* Unspecified */,
|
|
@@ -51020,7 +51016,8 @@ function createTypeChecker(host) {
|
|
|
51020
51016
|
const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0));
|
|
51021
51017
|
if (typeNode === void 0)
|
|
51022
51018
|
return Debug.fail("should always get typenode");
|
|
51023
|
-
const
|
|
51019
|
+
const options = { removeComments: type !== unresolvedType };
|
|
51020
|
+
const printer = createPrinter(options);
|
|
51024
51021
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
51025
51022
|
printer.writeNode(
|
|
51026
51023
|
4 /* Unspecified */,
|
|
@@ -54371,7 +54368,7 @@ function createTypeChecker(host) {
|
|
|
54371
54368
|
typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)
|
|
54372
54369
|
// TODO: GH#18217
|
|
54373
54370
|
);
|
|
54374
|
-
const printer =
|
|
54371
|
+
const printer = createPrinter({ removeComments: true });
|
|
54375
54372
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
54376
54373
|
printer.writeNode(
|
|
54377
54374
|
4 /* Unspecified */,
|
|
@@ -69399,7 +69396,7 @@ function createTypeChecker(host) {
|
|
|
69399
69396
|
return getNonMissingTypeOfSymbol(symbol);
|
|
69400
69397
|
}
|
|
69401
69398
|
function getControlFlowContainer(node) {
|
|
69402
|
-
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind ===
|
|
69399
|
+
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */);
|
|
69403
69400
|
}
|
|
69404
69401
|
function isSymbolAssigned(symbol) {
|
|
69405
69402
|
if (!symbol.valueDeclaration) {
|
|
@@ -69660,14 +69657,13 @@ function createTypeChecker(host) {
|
|
|
69660
69657
|
const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */;
|
|
69661
69658
|
const declarationContainer = getControlFlowContainer(declaration);
|
|
69662
69659
|
let flowContainer = getControlFlowContainer(node);
|
|
69663
|
-
const isCatch = flowContainer.kind === 295 /* CatchClause */;
|
|
69664
69660
|
const isOuterVariable = flowContainer !== declarationContainer;
|
|
69665
69661
|
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
|
|
69666
69662
|
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
|
|
69667
69663
|
while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
|
|
69668
69664
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
69669
69665
|
}
|
|
69670
|
-
const assumeInitialized = isParameter2 ||
|
|
69666
|
+
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 */;
|
|
69671
69667
|
const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
|
|
69672
69668
|
const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
|
|
69673
69669
|
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
|
|
@@ -111128,10 +111124,6 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
|
|
|
111128
111124
|
);
|
|
111129
111125
|
return outputFiles;
|
|
111130
111126
|
}
|
|
111131
|
-
var createPrinterWithDefaults = memoize(() => createPrinter({}));
|
|
111132
|
-
var createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true }));
|
|
111133
|
-
var createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true }));
|
|
111134
|
-
var createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true }));
|
|
111135
111127
|
function createPrinter(printerOptions = {}, handlers = {}) {
|
|
111136
111128
|
const {
|
|
111137
111129
|
hasGlobalName,
|
|
@@ -126919,10 +126911,6 @@ __export(ts_exports3, {
|
|
|
126919
126911
|
createPatternMatcher: () => createPatternMatcher,
|
|
126920
126912
|
createPrependNodes: () => createPrependNodes,
|
|
126921
126913
|
createPrinter: () => createPrinter,
|
|
126922
|
-
createPrinterWithDefaults: () => createPrinterWithDefaults,
|
|
126923
|
-
createPrinterWithRemoveComments: () => createPrinterWithRemoveComments,
|
|
126924
|
-
createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape,
|
|
126925
|
-
createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon,
|
|
126926
126914
|
createProgram: () => createProgram,
|
|
126927
126915
|
createProgramHost: () => createProgramHost,
|
|
126928
126916
|
createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral,
|
|
@@ -131015,7 +131003,7 @@ function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, f
|
|
|
131015
131003
|
function nodeToDisplayParts(node, enclosingDeclaration) {
|
|
131016
131004
|
const file = enclosingDeclaration.getSourceFile();
|
|
131017
131005
|
return mapToDisplayParts((writer) => {
|
|
131018
|
-
const printer =
|
|
131006
|
+
const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
131019
131007
|
printer.writeNode(4 /* Unspecified */, node, file, writer);
|
|
131020
131008
|
});
|
|
131021
131009
|
}
|
|
@@ -139478,7 +139466,7 @@ function getCallHierarchyItemName(program, node) {
|
|
|
139478
139466
|
}
|
|
139479
139467
|
}
|
|
139480
139468
|
if (text === void 0) {
|
|
139481
|
-
const printer =
|
|
139469
|
+
const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
139482
139470
|
text = usingSingleLineStringWriter((writer) => printer.writeNode(4 /* Unspecified */, node, node.getSourceFile(), writer));
|
|
139483
139471
|
}
|
|
139484
139472
|
return { text, pos: declName.getStart(), end: declName.getEnd() };
|
|
@@ -157248,7 +157236,8 @@ function provideInlayHints(context) {
|
|
|
157248
157236
|
}
|
|
157249
157237
|
function printTypeInSingleLine(type) {
|
|
157250
157238
|
const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */;
|
|
157251
|
-
const
|
|
157239
|
+
const options = { removeComments: true };
|
|
157240
|
+
const printer = createPrinter(options);
|
|
157252
157241
|
return usingSingleLineStringWriter((writer) => {
|
|
157253
157242
|
const typeNode = checker.typeToTypeNode(
|
|
157254
157243
|
type,
|
|
@@ -164179,7 +164168,7 @@ function createTypeHelpItems(symbol, { argumentCount, argumentsSpan: applicableS
|
|
|
164179
164168
|
}
|
|
164180
164169
|
function getTypeHelpItem(symbol, typeParameters, checker, enclosingDeclaration, sourceFile) {
|
|
164181
164170
|
const typeSymbolDisplay = symbolToDisplayParts(checker, symbol);
|
|
164182
|
-
const printer =
|
|
164171
|
+
const printer = createPrinter({ removeComments: true });
|
|
164183
164172
|
const parameters = typeParameters.map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer));
|
|
164184
164173
|
const documentation = symbol.getDocumentationComment(checker);
|
|
164185
164174
|
const tags = symbol.getJsDocTags(checker);
|
|
@@ -164223,7 +164212,7 @@ function returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, chec
|
|
|
164223
164212
|
}
|
|
164224
164213
|
function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {
|
|
164225
164214
|
const typeParameters = (candidateSignature.target || candidateSignature).typeParameters;
|
|
164226
|
-
const printer =
|
|
164215
|
+
const printer = createPrinter({ removeComments: true });
|
|
164227
164216
|
const parameters = (typeParameters || emptyArray).map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer));
|
|
164228
164217
|
const thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : [];
|
|
164229
164218
|
return checker.getExpandedParameters(candidateSignature).map((paramList) => {
|
|
@@ -164235,7 +164224,7 @@ function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclara
|
|
|
164235
164224
|
});
|
|
164236
164225
|
}
|
|
164237
164226
|
function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {
|
|
164238
|
-
const printer =
|
|
164227
|
+
const printer = createPrinter({ removeComments: true });
|
|
164239
164228
|
const typeParameterParts = mapToDisplayParts((writer) => {
|
|
164240
164229
|
if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) {
|
|
164241
164230
|
const args = factory.createNodeArray(candidateSignature.typeParameters.map((p) => checker.typeParameterToDeclaration(p, enclosingDeclaration, signatureHelpNodeBuilderFlags)));
|
|
@@ -164610,6 +164599,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
|
|
|
164610
164599
|
let hasAddedSymbolInfo = false;
|
|
164611
164600
|
const isThisExpression = location.kind === 108 /* ThisKeyword */ && isInExpressionContext(location) || isThisInTypeQuery(location);
|
|
164612
164601
|
let type;
|
|
164602
|
+
let printer;
|
|
164613
164603
|
let documentationFromAlias;
|
|
164614
164604
|
let tagsFromAlias;
|
|
164615
164605
|
let hasMultipleSignatures = false;
|
|
@@ -165002,7 +164992,10 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
|
|
|
165002
164992
|
}
|
|
165003
164993
|
return { displayParts, documentation, symbolKind, tags: tags.length === 0 ? void 0 : tags };
|
|
165004
164994
|
function getPrinter() {
|
|
165005
|
-
|
|
164995
|
+
if (!printer) {
|
|
164996
|
+
printer = createPrinter({ removeComments: true });
|
|
164997
|
+
}
|
|
164998
|
+
return printer;
|
|
165006
164999
|
}
|
|
165007
165000
|
function prefixNextMeaning() {
|
|
165008
165001
|
if (displayParts.length) {
|
|
@@ -181082,10 +181075,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
181082
181075
|
createPatternMatcher,
|
|
181083
181076
|
createPrependNodes,
|
|
181084
181077
|
createPrinter,
|
|
181085
|
-
createPrinterWithDefaults,
|
|
181086
|
-
createPrinterWithRemoveComments,
|
|
181087
|
-
createPrinterWithRemoveCommentsNeverAsciiEscape,
|
|
181088
|
-
createPrinterWithRemoveCommentsOmitTrailingSemicolon,
|
|
181089
181078
|
createProgram,
|
|
181090
181079
|
createProgramHost,
|
|
181091
181080
|
createPropertyNameNodeForIdentifierOrLiteral,
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -48708,7 +48708,7 @@ ${lanes.join("\n")}
|
|
|
48708
48708
|
return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker);
|
|
48709
48709
|
function symbolToStringWorker(writer2) {
|
|
48710
48710
|
const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
|
|
48711
|
-
const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ?
|
|
48711
|
+
const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinter({ removeComments: true, neverAsciiEscape: true }) : createPrinter({ removeComments: true });
|
|
48712
48712
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
48713
48713
|
printer.writeNode(
|
|
48714
48714
|
4 /* Unspecified */,
|
|
@@ -48730,7 +48730,7 @@ ${lanes.join("\n")}
|
|
|
48730
48730
|
sigOutput = kind === 1 /* Construct */ ? 177 /* ConstructSignature */ : 176 /* CallSignature */;
|
|
48731
48731
|
}
|
|
48732
48732
|
const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */);
|
|
48733
|
-
const printer =
|
|
48733
|
+
const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
48734
48734
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
48735
48735
|
printer.writeNode(
|
|
48736
48736
|
4 /* Unspecified */,
|
|
@@ -48747,7 +48747,8 @@ ${lanes.join("\n")}
|
|
|
48747
48747
|
const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0));
|
|
48748
48748
|
if (typeNode === void 0)
|
|
48749
48749
|
return Debug.fail("should always get typenode");
|
|
48750
|
-
const
|
|
48750
|
+
const options = { removeComments: type !== unresolvedType };
|
|
48751
|
+
const printer = createPrinter(options);
|
|
48751
48752
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
48752
48753
|
printer.writeNode(
|
|
48753
48754
|
4 /* Unspecified */,
|
|
@@ -52098,7 +52099,7 @@ ${lanes.join("\n")}
|
|
|
52098
52099
|
typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)
|
|
52099
52100
|
// TODO: GH#18217
|
|
52100
52101
|
);
|
|
52101
|
-
const printer =
|
|
52102
|
+
const printer = createPrinter({ removeComments: true });
|
|
52102
52103
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
52103
52104
|
printer.writeNode(
|
|
52104
52105
|
4 /* Unspecified */,
|
|
@@ -67126,7 +67127,7 @@ ${lanes.join("\n")}
|
|
|
67126
67127
|
return getNonMissingTypeOfSymbol(symbol);
|
|
67127
67128
|
}
|
|
67128
67129
|
function getControlFlowContainer(node) {
|
|
67129
|
-
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind ===
|
|
67130
|
+
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */);
|
|
67130
67131
|
}
|
|
67131
67132
|
function isSymbolAssigned(symbol) {
|
|
67132
67133
|
if (!symbol.valueDeclaration) {
|
|
@@ -67387,14 +67388,13 @@ ${lanes.join("\n")}
|
|
|
67387
67388
|
const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */;
|
|
67388
67389
|
const declarationContainer = getControlFlowContainer(declaration);
|
|
67389
67390
|
let flowContainer = getControlFlowContainer(node);
|
|
67390
|
-
const isCatch = flowContainer.kind === 295 /* CatchClause */;
|
|
67391
67391
|
const isOuterVariable = flowContainer !== declarationContainer;
|
|
67392
67392
|
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
|
|
67393
67393
|
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
|
|
67394
67394
|
while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
|
|
67395
67395
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
67396
67396
|
}
|
|
67397
|
-
const assumeInitialized = isParameter2 ||
|
|
67397
|
+
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 */;
|
|
67398
67398
|
const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
|
|
67399
67399
|
const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
|
|
67400
67400
|
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
|
|
@@ -113783,7 +113783,7 @@ ${lanes.join("\n")}
|
|
|
113783
113783
|
function getEmitListItem(emit, parenthesizerRule) {
|
|
113784
113784
|
return emit.length === 1 ? emitListItemNoParenthesizer : typeof parenthesizerRule === "object" ? emitListItemWithParenthesizerRuleSelector : emitListItemWithParenthesizerRule;
|
|
113785
113785
|
}
|
|
113786
|
-
var brackets, notImplementedResolver,
|
|
113786
|
+
var brackets, notImplementedResolver, TempFlags;
|
|
113787
113787
|
var init_emitter = __esm({
|
|
113788
113788
|
"src/compiler/emitter.ts"() {
|
|
113789
113789
|
"use strict";
|
|
@@ -113834,10 +113834,6 @@ ${lanes.join("\n")}
|
|
|
113834
113834
|
getDeclarationStatementsForSourceFile: notImplemented,
|
|
113835
113835
|
isImportRequiredByAugmentation: notImplemented
|
|
113836
113836
|
};
|
|
113837
|
-
createPrinterWithDefaults = memoize(() => createPrinter({}));
|
|
113838
|
-
createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true }));
|
|
113839
|
-
createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true }));
|
|
113840
|
-
createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true }));
|
|
113841
113837
|
TempFlags = /* @__PURE__ */ ((TempFlags2) => {
|
|
113842
113838
|
TempFlags2[TempFlags2["Auto"] = 0] = "Auto";
|
|
113843
113839
|
TempFlags2[TempFlags2["CountMask"] = 268435455] = "CountMask";
|
|
@@ -126892,7 +126888,7 @@ ${lanes.join("\n")}
|
|
|
126892
126888
|
function nodeToDisplayParts(node, enclosingDeclaration) {
|
|
126893
126889
|
const file = enclosingDeclaration.getSourceFile();
|
|
126894
126890
|
return mapToDisplayParts((writer) => {
|
|
126895
|
-
const printer =
|
|
126891
|
+
const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
126896
126892
|
printer.writeNode(4 /* Unspecified */, node, file, writer);
|
|
126897
126893
|
});
|
|
126898
126894
|
}
|
|
@@ -135517,7 +135513,7 @@ ${lanes.join("\n")}
|
|
|
135517
135513
|
}
|
|
135518
135514
|
}
|
|
135519
135515
|
if (text === void 0) {
|
|
135520
|
-
const printer =
|
|
135516
|
+
const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
135521
135517
|
text = usingSingleLineStringWriter((writer) => printer.writeNode(4 /* Unspecified */, node, node.getSourceFile(), writer));
|
|
135522
135518
|
}
|
|
135523
135519
|
return { text, pos: declName.getStart(), end: declName.getEnd() };
|
|
@@ -153998,7 +153994,8 @@ ${lanes.join("\n")}
|
|
|
153998
153994
|
}
|
|
153999
153995
|
function printTypeInSingleLine(type) {
|
|
154000
153996
|
const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */;
|
|
154001
|
-
const
|
|
153997
|
+
const options = { removeComments: true };
|
|
153998
|
+
const printer = createPrinter(options);
|
|
154002
153999
|
return usingSingleLineStringWriter((writer) => {
|
|
154003
154000
|
const typeNode = checker.typeToTypeNode(
|
|
154004
154001
|
type,
|
|
@@ -161173,7 +161170,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161173
161170
|
}
|
|
161174
161171
|
function getTypeHelpItem(symbol, typeParameters, checker, enclosingDeclaration, sourceFile) {
|
|
161175
161172
|
const typeSymbolDisplay = symbolToDisplayParts(checker, symbol);
|
|
161176
|
-
const printer =
|
|
161173
|
+
const printer = createPrinter({ removeComments: true });
|
|
161177
161174
|
const parameters = typeParameters.map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer));
|
|
161178
161175
|
const documentation = symbol.getDocumentationComment(checker);
|
|
161179
161176
|
const tags = symbol.getJsDocTags(checker);
|
|
@@ -161216,7 +161213,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161216
161213
|
}
|
|
161217
161214
|
function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {
|
|
161218
161215
|
const typeParameters = (candidateSignature.target || candidateSignature).typeParameters;
|
|
161219
|
-
const printer =
|
|
161216
|
+
const printer = createPrinter({ removeComments: true });
|
|
161220
161217
|
const parameters = (typeParameters || emptyArray).map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer));
|
|
161221
161218
|
const thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : [];
|
|
161222
161219
|
return checker.getExpandedParameters(candidateSignature).map((paramList) => {
|
|
@@ -161228,7 +161225,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161228
161225
|
});
|
|
161229
161226
|
}
|
|
161230
161227
|
function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {
|
|
161231
|
-
const printer =
|
|
161228
|
+
const printer = createPrinter({ removeComments: true });
|
|
161232
161229
|
const typeParameterParts = mapToDisplayParts((writer) => {
|
|
161233
161230
|
if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) {
|
|
161234
161231
|
const args = factory.createNodeArray(candidateSignature.typeParameters.map((p) => checker.typeParameterToDeclaration(p, enclosingDeclaration, signatureHelpNodeBuilderFlags)));
|
|
@@ -161634,6 +161631,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161634
161631
|
let hasAddedSymbolInfo = false;
|
|
161635
161632
|
const isThisExpression = location.kind === 108 /* ThisKeyword */ && isInExpressionContext(location) || isThisInTypeQuery(location);
|
|
161636
161633
|
let type;
|
|
161634
|
+
let printer;
|
|
161637
161635
|
let documentationFromAlias;
|
|
161638
161636
|
let tagsFromAlias;
|
|
161639
161637
|
let hasMultipleSignatures = false;
|
|
@@ -162026,7 +162024,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162026
162024
|
}
|
|
162027
162025
|
return { displayParts, documentation, symbolKind, tags: tags.length === 0 ? void 0 : tags };
|
|
162028
162026
|
function getPrinter() {
|
|
162029
|
-
|
|
162027
|
+
if (!printer) {
|
|
162028
|
+
printer = createPrinter({ removeComments: true });
|
|
162029
|
+
}
|
|
162030
|
+
return printer;
|
|
162030
162031
|
}
|
|
162031
162032
|
function prefixNextMeaning() {
|
|
162032
162033
|
if (displayParts.length) {
|
|
@@ -177733,10 +177734,6 @@ ${e.message}`;
|
|
|
177733
177734
|
createPatternMatcher: () => createPatternMatcher,
|
|
177734
177735
|
createPrependNodes: () => createPrependNodes,
|
|
177735
177736
|
createPrinter: () => createPrinter,
|
|
177736
|
-
createPrinterWithDefaults: () => createPrinterWithDefaults,
|
|
177737
|
-
createPrinterWithRemoveComments: () => createPrinterWithRemoveComments,
|
|
177738
|
-
createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape,
|
|
177739
|
-
createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon,
|
|
177740
177737
|
createProgram: () => createProgram,
|
|
177741
177738
|
createProgramHost: () => createProgramHost,
|
|
177742
177739
|
createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral,
|
|
@@ -180089,10 +180086,6 @@ ${e.message}`;
|
|
|
180089
180086
|
createPatternMatcher: () => createPatternMatcher,
|
|
180090
180087
|
createPrependNodes: () => createPrependNodes,
|
|
180091
180088
|
createPrinter: () => createPrinter,
|
|
180092
|
-
createPrinterWithDefaults: () => createPrinterWithDefaults,
|
|
180093
|
-
createPrinterWithRemoveComments: () => createPrinterWithRemoveComments,
|
|
180094
|
-
createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape,
|
|
180095
|
-
createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon,
|
|
180096
180089
|
createProgram: () => createProgram,
|
|
180097
180090
|
createProgramHost: () => createProgramHost,
|
|
180098
180091
|
createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral,
|
package/lib/typescript.js
CHANGED
|
@@ -48708,7 +48708,7 @@ ${lanes.join("\n")}
|
|
|
48708
48708
|
return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker);
|
|
48709
48709
|
function symbolToStringWorker(writer2) {
|
|
48710
48710
|
const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
|
|
48711
|
-
const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ?
|
|
48711
|
+
const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinter({ removeComments: true, neverAsciiEscape: true }) : createPrinter({ removeComments: true });
|
|
48712
48712
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
48713
48713
|
printer.writeNode(
|
|
48714
48714
|
4 /* Unspecified */,
|
|
@@ -48730,7 +48730,7 @@ ${lanes.join("\n")}
|
|
|
48730
48730
|
sigOutput = kind === 1 /* Construct */ ? 177 /* ConstructSignature */ : 176 /* CallSignature */;
|
|
48731
48731
|
}
|
|
48732
48732
|
const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */);
|
|
48733
|
-
const printer =
|
|
48733
|
+
const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
48734
48734
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
48735
48735
|
printer.writeNode(
|
|
48736
48736
|
4 /* Unspecified */,
|
|
@@ -48747,7 +48747,8 @@ ${lanes.join("\n")}
|
|
|
48747
48747
|
const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0));
|
|
48748
48748
|
if (typeNode === void 0)
|
|
48749
48749
|
return Debug.fail("should always get typenode");
|
|
48750
|
-
const
|
|
48750
|
+
const options = { removeComments: type !== unresolvedType };
|
|
48751
|
+
const printer = createPrinter(options);
|
|
48751
48752
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
48752
48753
|
printer.writeNode(
|
|
48753
48754
|
4 /* Unspecified */,
|
|
@@ -52098,7 +52099,7 @@ ${lanes.join("\n")}
|
|
|
52098
52099
|
typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)
|
|
52099
52100
|
// TODO: GH#18217
|
|
52100
52101
|
);
|
|
52101
|
-
const printer =
|
|
52102
|
+
const printer = createPrinter({ removeComments: true });
|
|
52102
52103
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
52103
52104
|
printer.writeNode(
|
|
52104
52105
|
4 /* Unspecified */,
|
|
@@ -67126,7 +67127,7 @@ ${lanes.join("\n")}
|
|
|
67126
67127
|
return getNonMissingTypeOfSymbol(symbol);
|
|
67127
67128
|
}
|
|
67128
67129
|
function getControlFlowContainer(node) {
|
|
67129
|
-
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind ===
|
|
67130
|
+
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 /* ModuleBlock */ || node2.kind === 308 /* SourceFile */ || node2.kind === 169 /* PropertyDeclaration */);
|
|
67130
67131
|
}
|
|
67131
67132
|
function isSymbolAssigned(symbol) {
|
|
67132
67133
|
if (!symbol.valueDeclaration) {
|
|
@@ -67387,14 +67388,13 @@ ${lanes.join("\n")}
|
|
|
67387
67388
|
const isParameter2 = getRootDeclaration(declaration).kind === 166 /* Parameter */;
|
|
67388
67389
|
const declarationContainer = getControlFlowContainer(declaration);
|
|
67389
67390
|
let flowContainer = getControlFlowContainer(node);
|
|
67390
|
-
const isCatch = flowContainer.kind === 295 /* CatchClause */;
|
|
67391
67391
|
const isOuterVariable = flowContainer !== declarationContainer;
|
|
67392
67392
|
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
|
|
67393
67393
|
const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
|
|
67394
67394
|
while (flowContainer !== declarationContainer && (flowContainer.kind === 215 /* FunctionExpression */ || flowContainer.kind === 216 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
|
|
67395
67395
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
67396
67396
|
}
|
|
67397
|
-
const assumeInitialized = isParameter2 ||
|
|
67397
|
+
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 */;
|
|
67398
67398
|
const initialType = assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type);
|
|
67399
67399
|
const flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
|
|
67400
67400
|
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
|
|
@@ -113783,7 +113783,7 @@ ${lanes.join("\n")}
|
|
|
113783
113783
|
function getEmitListItem(emit, parenthesizerRule) {
|
|
113784
113784
|
return emit.length === 1 ? emitListItemNoParenthesizer : typeof parenthesizerRule === "object" ? emitListItemWithParenthesizerRuleSelector : emitListItemWithParenthesizerRule;
|
|
113785
113785
|
}
|
|
113786
|
-
var brackets, notImplementedResolver,
|
|
113786
|
+
var brackets, notImplementedResolver, TempFlags;
|
|
113787
113787
|
var init_emitter = __esm({
|
|
113788
113788
|
"src/compiler/emitter.ts"() {
|
|
113789
113789
|
"use strict";
|
|
@@ -113834,10 +113834,6 @@ ${lanes.join("\n")}
|
|
|
113834
113834
|
getDeclarationStatementsForSourceFile: notImplemented,
|
|
113835
113835
|
isImportRequiredByAugmentation: notImplemented
|
|
113836
113836
|
};
|
|
113837
|
-
createPrinterWithDefaults = memoize(() => createPrinter({}));
|
|
113838
|
-
createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true }));
|
|
113839
|
-
createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true }));
|
|
113840
|
-
createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true }));
|
|
113841
113837
|
TempFlags = /* @__PURE__ */ ((TempFlags2) => {
|
|
113842
113838
|
TempFlags2[TempFlags2["Auto"] = 0] = "Auto";
|
|
113843
113839
|
TempFlags2[TempFlags2["CountMask"] = 268435455] = "CountMask";
|
|
@@ -126906,7 +126902,7 @@ ${lanes.join("\n")}
|
|
|
126906
126902
|
function nodeToDisplayParts(node, enclosingDeclaration) {
|
|
126907
126903
|
const file = enclosingDeclaration.getSourceFile();
|
|
126908
126904
|
return mapToDisplayParts((writer) => {
|
|
126909
|
-
const printer =
|
|
126905
|
+
const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
126910
126906
|
printer.writeNode(4 /* Unspecified */, node, file, writer);
|
|
126911
126907
|
});
|
|
126912
126908
|
}
|
|
@@ -135531,7 +135527,7 @@ ${lanes.join("\n")}
|
|
|
135531
135527
|
}
|
|
135532
135528
|
}
|
|
135533
135529
|
if (text === void 0) {
|
|
135534
|
-
const printer =
|
|
135530
|
+
const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
135535
135531
|
text = usingSingleLineStringWriter((writer) => printer.writeNode(4 /* Unspecified */, node, node.getSourceFile(), writer));
|
|
135536
135532
|
}
|
|
135537
135533
|
return { text, pos: declName.getStart(), end: declName.getEnd() };
|
|
@@ -154012,7 +154008,8 @@ ${lanes.join("\n")}
|
|
|
154012
154008
|
}
|
|
154013
154009
|
function printTypeInSingleLine(type) {
|
|
154014
154010
|
const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */;
|
|
154015
|
-
const
|
|
154011
|
+
const options = { removeComments: true };
|
|
154012
|
+
const printer = createPrinter(options);
|
|
154016
154013
|
return usingSingleLineStringWriter((writer) => {
|
|
154017
154014
|
const typeNode = checker.typeToTypeNode(
|
|
154018
154015
|
type,
|
|
@@ -161187,7 +161184,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161187
161184
|
}
|
|
161188
161185
|
function getTypeHelpItem(symbol, typeParameters, checker, enclosingDeclaration, sourceFile) {
|
|
161189
161186
|
const typeSymbolDisplay = symbolToDisplayParts(checker, symbol);
|
|
161190
|
-
const printer =
|
|
161187
|
+
const printer = createPrinter({ removeComments: true });
|
|
161191
161188
|
const parameters = typeParameters.map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer));
|
|
161192
161189
|
const documentation = symbol.getDocumentationComment(checker);
|
|
161193
161190
|
const tags = symbol.getJsDocTags(checker);
|
|
@@ -161230,7 +161227,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161230
161227
|
}
|
|
161231
161228
|
function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {
|
|
161232
161229
|
const typeParameters = (candidateSignature.target || candidateSignature).typeParameters;
|
|
161233
|
-
const printer =
|
|
161230
|
+
const printer = createPrinter({ removeComments: true });
|
|
161234
161231
|
const parameters = (typeParameters || emptyArray).map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer));
|
|
161235
161232
|
const thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : [];
|
|
161236
161233
|
return checker.getExpandedParameters(candidateSignature).map((paramList) => {
|
|
@@ -161242,7 +161239,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161242
161239
|
});
|
|
161243
161240
|
}
|
|
161244
161241
|
function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {
|
|
161245
|
-
const printer =
|
|
161242
|
+
const printer = createPrinter({ removeComments: true });
|
|
161246
161243
|
const typeParameterParts = mapToDisplayParts((writer) => {
|
|
161247
161244
|
if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) {
|
|
161248
161245
|
const args = factory.createNodeArray(candidateSignature.typeParameters.map((p) => checker.typeParameterToDeclaration(p, enclosingDeclaration, signatureHelpNodeBuilderFlags)));
|
|
@@ -161648,6 +161645,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161648
161645
|
let hasAddedSymbolInfo = false;
|
|
161649
161646
|
const isThisExpression = location.kind === 108 /* ThisKeyword */ && isInExpressionContext(location) || isThisInTypeQuery(location);
|
|
161650
161647
|
let type;
|
|
161648
|
+
let printer;
|
|
161651
161649
|
let documentationFromAlias;
|
|
161652
161650
|
let tagsFromAlias;
|
|
161653
161651
|
let hasMultipleSignatures = false;
|
|
@@ -162040,7 +162038,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162040
162038
|
}
|
|
162041
162039
|
return { displayParts, documentation, symbolKind, tags: tags.length === 0 ? void 0 : tags };
|
|
162042
162040
|
function getPrinter() {
|
|
162043
|
-
|
|
162041
|
+
if (!printer) {
|
|
162042
|
+
printer = createPrinter({ removeComments: true });
|
|
162043
|
+
}
|
|
162044
|
+
return printer;
|
|
162044
162045
|
}
|
|
162045
162046
|
function prefixNextMeaning() {
|
|
162046
162047
|
if (displayParts.length) {
|
|
@@ -166918,10 +166919,6 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
166918
166919
|
createPatternMatcher: () => createPatternMatcher,
|
|
166919
166920
|
createPrependNodes: () => createPrependNodes,
|
|
166920
166921
|
createPrinter: () => createPrinter,
|
|
166921
|
-
createPrinterWithDefaults: () => createPrinterWithDefaults,
|
|
166922
|
-
createPrinterWithRemoveComments: () => createPrinterWithRemoveComments,
|
|
166923
|
-
createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape,
|
|
166924
|
-
createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon,
|
|
166925
166922
|
createProgram: () => createProgram,
|
|
166926
166923
|
createProgramHost: () => createProgramHost,
|
|
166927
166924
|
createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral,
|