@typescript-deploys/pr-build 5.0.0-pr-52899-9 → 5.0.0-pr-49226-5
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 +90 -61
- package/lib/tsserver.js +91 -91
- package/lib/tsserverlibrary.js +91 -91
- package/lib/typescript.js +91 -91
- package/lib/typingsInstaller.js +81 -50
- package/package.json +1 -1
package/lib/tsserver.js
CHANGED
|
@@ -2288,7 +2288,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2288
2288
|
|
|
2289
2289
|
// src/compiler/corePublic.ts
|
|
2290
2290
|
var versionMajorMinor = "5.0";
|
|
2291
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2291
|
+
var version = `${versionMajorMinor}.0-insiders.20230225`;
|
|
2292
2292
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2293
2293
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2294
2294
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -10354,12 +10354,10 @@ var Diagnostics = {
|
|
|
10354
10354
|
The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."),
|
|
10355
10355
|
Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."),
|
|
10356
10356
|
Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."),
|
|
10357
|
-
|
|
10357
|
+
Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'es2015' or later."),
|
|
10358
10358
|
Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."),
|
|
10359
10359
|
An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."),
|
|
10360
10360
|
Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),
|
|
10361
|
-
Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(5099, 1 /* Error */, "Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Aster_5099", `Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`),
|
|
10362
|
-
Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead: diag(5100, 1 /* Error */, "Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_defau_5100", "Export assignment cannot be used when 'moduleResolution' is set to 'bundler'. Consider using 'export default' or another module format instead."),
|
|
10363
10361
|
Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecat_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`),
|
|
10364
10362
|
Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."),
|
|
10365
10363
|
Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."),
|
|
@@ -11289,8 +11287,7 @@ var Diagnostics = {
|
|
|
11289
11287
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
11290
11288
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
11291
11289
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
11292
|
-
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.")
|
|
11293
|
-
Add_missing_comma_for_an_object_member_completion_0: diag(18052, 3 /* Message */, "Add_missing_comma_for_an_object_member_completion_0_18052", "Add missing comma for an object member completion '{0}'.")
|
|
11290
|
+
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.")
|
|
11294
11291
|
};
|
|
11295
11292
|
|
|
11296
11293
|
// src/compiler/scanner.ts
|
|
@@ -30407,6 +30404,34 @@ var Parser;
|
|
|
30407
30404
|
))
|
|
30408
30405
|
};
|
|
30409
30406
|
var factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory);
|
|
30407
|
+
var {
|
|
30408
|
+
createNodeArray: factoryCreateNodeArray,
|
|
30409
|
+
createNumericLiteral: factoryCreateNumericLiteral,
|
|
30410
|
+
createStringLiteral: factoryCreateStringLiteral,
|
|
30411
|
+
createLiteralLikeNode: factoryCreateLiteralLikeNode,
|
|
30412
|
+
createIdentifier: factoryCreateIdentifier,
|
|
30413
|
+
createPrivateIdentifier: factoryCreatePrivateIdentifier,
|
|
30414
|
+
createToken: factoryCreateToken,
|
|
30415
|
+
createArrayLiteralExpression: factoryCreateArrayLiteralExpression,
|
|
30416
|
+
createObjectLiteralExpression: factoryCreateObjectLiteralExpression,
|
|
30417
|
+
createPropertyAccessExpression: factoryCreatePropertyAccessExpression,
|
|
30418
|
+
createPropertyAccessChain: factoryCreatePropertyAccessChain,
|
|
30419
|
+
createElementAccessExpression: factoryCreateElementAccessExpression,
|
|
30420
|
+
createElementAccessChain: factoryCreateElementAccessChain,
|
|
30421
|
+
createCallExpression: factoryCreateCallExpression,
|
|
30422
|
+
createCallChain: factoryCreateCallChain,
|
|
30423
|
+
createNewExpression: factoryCreateNewExpression,
|
|
30424
|
+
createParenthesizedExpression: factoryCreateParenthesizedExpression,
|
|
30425
|
+
createBlock: factoryCreateBlock,
|
|
30426
|
+
createVariableStatement: factoryCreateVariableStatement,
|
|
30427
|
+
createExpressionStatement: factoryCreateExpressionStatement,
|
|
30428
|
+
createIfStatement: factoryCreateIfStatement,
|
|
30429
|
+
createWhileStatement: factoryCreateWhileStatement,
|
|
30430
|
+
createForStatement: factoryCreateForStatement,
|
|
30431
|
+
createForOfStatement: factoryCreateForOfStatement,
|
|
30432
|
+
createVariableDeclaration: factoryCreateVariableDeclaration,
|
|
30433
|
+
createVariableDeclarationList: factoryCreateVariableDeclarationList
|
|
30434
|
+
} = factory2;
|
|
30410
30435
|
var fileName;
|
|
30411
30436
|
var sourceFlags;
|
|
30412
30437
|
var sourceText;
|
|
@@ -30524,8 +30549,8 @@ var Parser;
|
|
|
30524
30549
|
}
|
|
30525
30550
|
}
|
|
30526
30551
|
}
|
|
30527
|
-
const expression = isArray(expressions) ? finishNode(
|
|
30528
|
-
const statement =
|
|
30552
|
+
const expression = isArray(expressions) ? finishNode(factoryCreateArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions);
|
|
30553
|
+
const statement = factoryCreateExpressionStatement(expression);
|
|
30529
30554
|
finishNode(statement, pos);
|
|
30530
30555
|
statements = createNodeArray([statement], pos);
|
|
30531
30556
|
endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, Diagnostics.Unexpected_token);
|
|
@@ -30708,7 +30733,7 @@ var Parser;
|
|
|
30708
30733
|
}
|
|
30709
30734
|
}
|
|
30710
30735
|
syntaxCursor = savedSyntaxCursor;
|
|
30711
|
-
return factory2.updateSourceFile(sourceFile, setTextRange(
|
|
30736
|
+
return factory2.updateSourceFile(sourceFile, setTextRange(factoryCreateNodeArray(statements), sourceFile.statements));
|
|
30712
30737
|
function containsPossibleTopLevelAwait(node) {
|
|
30713
30738
|
return !(node.flags & 32768 /* AwaitContext */) && !!(node.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */);
|
|
30714
30739
|
}
|
|
@@ -31149,13 +31174,13 @@ var Parser;
|
|
|
31149
31174
|
const pos = getNodePos();
|
|
31150
31175
|
const kind = token();
|
|
31151
31176
|
nextToken();
|
|
31152
|
-
return finishNode(
|
|
31177
|
+
return finishNode(factoryCreateToken(kind), pos);
|
|
31153
31178
|
}
|
|
31154
31179
|
function parseTokenNodeJSDoc() {
|
|
31155
31180
|
const pos = getNodePos();
|
|
31156
31181
|
const kind = token();
|
|
31157
31182
|
nextTokenJSDoc();
|
|
31158
|
-
return finishNode(
|
|
31183
|
+
return finishNode(factoryCreateToken(kind), pos);
|
|
31159
31184
|
}
|
|
31160
31185
|
function canParseSemicolon() {
|
|
31161
31186
|
if (token() === 26 /* SemicolonToken */) {
|
|
@@ -31176,7 +31201,7 @@ var Parser;
|
|
|
31176
31201
|
return tryParseSemicolon() || parseExpected(26 /* SemicolonToken */);
|
|
31177
31202
|
}
|
|
31178
31203
|
function createNodeArray(elements, pos, end, hasTrailingComma) {
|
|
31179
|
-
const array =
|
|
31204
|
+
const array = factoryCreateNodeArray(elements, hasTrailingComma);
|
|
31180
31205
|
setTextRangePosEnd(array, pos, end != null ? end : scanner2.getStartPos());
|
|
31181
31206
|
return array;
|
|
31182
31207
|
}
|
|
@@ -31198,7 +31223,7 @@ var Parser;
|
|
|
31198
31223
|
parseErrorAtCurrentToken(diagnosticMessage, arg0);
|
|
31199
31224
|
}
|
|
31200
31225
|
const pos = getNodePos();
|
|
31201
|
-
const result = kind === 79 /* Identifier */ ?
|
|
31226
|
+
const result = kind === 79 /* Identifier */ ? factoryCreateIdentifier(
|
|
31202
31227
|
"",
|
|
31203
31228
|
/*originalKeywordKind*/
|
|
31204
31229
|
void 0
|
|
@@ -31208,15 +31233,15 @@ var Parser;
|
|
|
31208
31233
|
"",
|
|
31209
31234
|
/*templateFlags*/
|
|
31210
31235
|
void 0
|
|
31211
|
-
) : kind === 8 /* NumericLiteral */ ?
|
|
31236
|
+
) : kind === 8 /* NumericLiteral */ ? factoryCreateNumericLiteral(
|
|
31212
31237
|
"",
|
|
31213
31238
|
/*numericLiteralFlags*/
|
|
31214
31239
|
void 0
|
|
31215
|
-
) : kind === 10 /* StringLiteral */ ?
|
|
31240
|
+
) : kind === 10 /* StringLiteral */ ? factoryCreateStringLiteral(
|
|
31216
31241
|
"",
|
|
31217
31242
|
/*isSingleQuote*/
|
|
31218
31243
|
void 0
|
|
31219
|
-
) : kind === 279 /* MissingDeclaration */ ? factory2.createMissingDeclaration() :
|
|
31244
|
+
) : kind === 279 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factoryCreateToken(kind);
|
|
31220
31245
|
return finishNode(result, pos);
|
|
31221
31246
|
}
|
|
31222
31247
|
function internIdentifier(text) {
|
|
@@ -31234,7 +31259,7 @@ var Parser;
|
|
|
31234
31259
|
const text = internIdentifier(scanner2.getTokenValue());
|
|
31235
31260
|
const hasExtendedUnicodeEscape = scanner2.hasExtendedUnicodeEscape();
|
|
31236
31261
|
nextTokenWithoutCheck();
|
|
31237
|
-
return finishNode(
|
|
31262
|
+
return finishNode(factoryCreateIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos);
|
|
31238
31263
|
}
|
|
31239
31264
|
if (token() === 80 /* PrivateIdentifier */) {
|
|
31240
31265
|
parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
@@ -31305,7 +31330,7 @@ var Parser;
|
|
|
31305
31330
|
}
|
|
31306
31331
|
function parsePrivateIdentifier() {
|
|
31307
31332
|
const pos = getNodePos();
|
|
31308
|
-
const node =
|
|
31333
|
+
const node = factoryCreatePrivateIdentifier(internIdentifier(scanner2.getTokenValue()));
|
|
31309
31334
|
nextToken();
|
|
31310
31335
|
return finishNode(node, pos);
|
|
31311
31336
|
}
|
|
@@ -32020,12 +32045,12 @@ var Parser;
|
|
|
32020
32045
|
// never get a token like this. Instead, we would get 00 and 9 as two separate tokens.
|
|
32021
32046
|
// We also do not need to check for negatives because any prefix operator would be part of a
|
|
32022
32047
|
// parent unary expression.
|
|
32023
|
-
kind === 8 /* NumericLiteral */ ?
|
|
32048
|
+
kind === 8 /* NumericLiteral */ ? factoryCreateNumericLiteral(scanner2.getTokenValue(), scanner2.getNumericLiteralFlags()) : kind === 10 /* StringLiteral */ ? factoryCreateStringLiteral(
|
|
32024
32049
|
scanner2.getTokenValue(),
|
|
32025
32050
|
/*isSingleQuote*/
|
|
32026
32051
|
void 0,
|
|
32027
32052
|
scanner2.hasExtendedUnicodeEscape()
|
|
32028
|
-
) : isLiteralKind(kind) ?
|
|
32053
|
+
) : isLiteralKind(kind) ? factoryCreateLiteralLikeNode(kind, scanner2.getTokenValue()) : Debug.fail()
|
|
32029
32054
|
);
|
|
32030
32055
|
if (scanner2.hasExtendedUnicodeEscape()) {
|
|
32031
32056
|
node.hasExtendedUnicodeEscape = true;
|
|
@@ -32616,7 +32641,7 @@ var Parser;
|
|
|
32616
32641
|
if (token() === 126 /* AbstractKeyword */) {
|
|
32617
32642
|
const pos = getNodePos();
|
|
32618
32643
|
nextToken();
|
|
32619
|
-
const modifier = finishNode(
|
|
32644
|
+
const modifier = finishNode(factoryCreateToken(126 /* AbstractKeyword */), pos);
|
|
32620
32645
|
modifiers = createNodeArray([modifier], pos);
|
|
32621
32646
|
}
|
|
32622
32647
|
return modifiers;
|
|
@@ -33673,7 +33698,7 @@ var Parser;
|
|
|
33673
33698
|
return expression;
|
|
33674
33699
|
}
|
|
33675
33700
|
parseExpectedToken(24 /* DotToken */, Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
|
|
33676
|
-
return finishNode(
|
|
33701
|
+
return finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot(
|
|
33677
33702
|
/*allowIdentifierNames*/
|
|
33678
33703
|
true,
|
|
33679
33704
|
/*allowPrivateIdentifiers*/
|
|
@@ -33694,7 +33719,7 @@ var Parser;
|
|
|
33694
33719
|
factory2.createJsxElement(
|
|
33695
33720
|
lastChild.openingElement,
|
|
33696
33721
|
lastChild.children,
|
|
33697
|
-
finishNode(factory2.createJsxClosingElement(finishNode(
|
|
33722
|
+
finishNode(factory2.createJsxClosingElement(finishNode(factoryCreateIdentifier(""), end, end)), end, end)
|
|
33698
33723
|
),
|
|
33699
33724
|
lastChild.openingElement.pos,
|
|
33700
33725
|
end
|
|
@@ -33837,7 +33862,7 @@ var Parser;
|
|
|
33837
33862
|
scanJsxIdentifier();
|
|
33838
33863
|
let expression = token() === 108 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName();
|
|
33839
33864
|
while (parseOptional(24 /* DotToken */)) {
|
|
33840
|
-
expression = finishNode(
|
|
33865
|
+
expression = finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot(
|
|
33841
33866
|
/*allowIdentifierNames*/
|
|
33842
33867
|
true,
|
|
33843
33868
|
/*allowPrivateIdentifiers*/
|
|
@@ -33988,7 +34013,7 @@ var Parser;
|
|
|
33988
34013
|
true
|
|
33989
34014
|
);
|
|
33990
34015
|
const isOptionalChain2 = questionDotToken || tryReparseOptionalChain(expression);
|
|
33991
|
-
const propertyAccess = isOptionalChain2 ?
|
|
34016
|
+
const propertyAccess = isOptionalChain2 ? factoryCreatePropertyAccessChain(expression, questionDotToken, name) : factoryCreatePropertyAccessExpression(expression, name);
|
|
33992
34017
|
if (isOptionalChain2 && isPrivateIdentifier(propertyAccess.name)) {
|
|
33993
34018
|
parseErrorAtRange(propertyAccess.name, Diagnostics.An_optional_chain_cannot_contain_private_identifiers);
|
|
33994
34019
|
}
|
|
@@ -34016,7 +34041,7 @@ var Parser;
|
|
|
34016
34041
|
argumentExpression = argument;
|
|
34017
34042
|
}
|
|
34018
34043
|
parseExpected(23 /* CloseBracketToken */);
|
|
34019
|
-
const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ?
|
|
34044
|
+
const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateElementAccessChain(expression, questionDotToken, argumentExpression) : factoryCreateElementAccessExpression(expression, argumentExpression);
|
|
34020
34045
|
return finishNode(indexedAccess, pos);
|
|
34021
34046
|
}
|
|
34022
34047
|
function parseMemberExpressionRest(pos, expression, allowOptionalChain) {
|
|
@@ -34103,7 +34128,7 @@ var Parser;
|
|
|
34103
34128
|
expression = expression.expression;
|
|
34104
34129
|
}
|
|
34105
34130
|
const argumentList = parseArgumentList();
|
|
34106
|
-
const callExpr = questionDotToken || tryReparseOptionalChain(expression) ?
|
|
34131
|
+
const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateCallChain(expression, questionDotToken, typeArguments, argumentList) : factoryCreateCallExpression(expression, typeArguments, argumentList);
|
|
34107
34132
|
expression = finishNode(callExpr, pos);
|
|
34108
34133
|
continue;
|
|
34109
34134
|
}
|
|
@@ -34114,7 +34139,7 @@ var Parser;
|
|
|
34114
34139
|
false,
|
|
34115
34140
|
Diagnostics.Identifier_expected
|
|
34116
34141
|
);
|
|
34117
|
-
expression = finishNode(
|
|
34142
|
+
expression = finishNode(factoryCreatePropertyAccessChain(expression, questionDotToken, name), pos);
|
|
34118
34143
|
}
|
|
34119
34144
|
break;
|
|
34120
34145
|
}
|
|
@@ -34209,7 +34234,7 @@ var Parser;
|
|
|
34209
34234
|
parseExpected(20 /* OpenParenToken */);
|
|
34210
34235
|
const expression = allowInAnd(parseExpression);
|
|
34211
34236
|
parseExpected(21 /* CloseParenToken */);
|
|
34212
|
-
return withJSDoc(finishNode(
|
|
34237
|
+
return withJSDoc(finishNode(factoryCreateParenthesizedExpression(expression), pos), hasJSDoc);
|
|
34213
34238
|
}
|
|
34214
34239
|
function parseSpreadElement() {
|
|
34215
34240
|
const pos = getNodePos();
|
|
@@ -34236,7 +34261,7 @@ var Parser;
|
|
|
34236
34261
|
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
34237
34262
|
const elements = parseDelimitedList(15 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement);
|
|
34238
34263
|
parseExpectedMatchingBrackets(22 /* OpenBracketToken */, 23 /* CloseBracketToken */, openBracketParsed, openBracketPosition);
|
|
34239
|
-
return finishNode(
|
|
34264
|
+
return finishNode(factoryCreateArrayLiteralExpression(elements, multiLine), pos);
|
|
34240
34265
|
}
|
|
34241
34266
|
function parseObjectLiteralElement() {
|
|
34242
34267
|
const pos = getNodePos();
|
|
@@ -34301,7 +34326,7 @@ var Parser;
|
|
|
34301
34326
|
true
|
|
34302
34327
|
);
|
|
34303
34328
|
parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition);
|
|
34304
|
-
return finishNode(
|
|
34329
|
+
return finishNode(factoryCreateObjectLiteralExpression(properties, multiLine), pos);
|
|
34305
34330
|
}
|
|
34306
34331
|
function parseFunctionExpression() {
|
|
34307
34332
|
const savedDecoratorContext = inDecoratorContext();
|
|
@@ -34358,7 +34383,7 @@ var Parser;
|
|
|
34358
34383
|
parseErrorAtCurrentToken(Diagnostics.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0, getTextOfNodeFromSourceText(sourceText, expression));
|
|
34359
34384
|
}
|
|
34360
34385
|
const argumentList = token() === 20 /* OpenParenToken */ ? parseArgumentList() : void 0;
|
|
34361
|
-
return finishNode(
|
|
34386
|
+
return finishNode(factoryCreateNewExpression(expression, typeArguments, argumentList), pos);
|
|
34362
34387
|
}
|
|
34363
34388
|
function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
|
|
34364
34389
|
const pos = getNodePos();
|
|
@@ -34369,7 +34394,7 @@ var Parser;
|
|
|
34369
34394
|
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
34370
34395
|
const statements = parseList(1 /* BlockStatements */, parseStatement);
|
|
34371
34396
|
parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition);
|
|
34372
|
-
const result = withJSDoc(finishNode(
|
|
34397
|
+
const result = withJSDoc(finishNode(factoryCreateBlock(statements, multiLine), pos), hasJSDoc);
|
|
34373
34398
|
if (token() === 63 /* EqualsToken */) {
|
|
34374
34399
|
parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses);
|
|
34375
34400
|
nextToken();
|
|
@@ -34377,7 +34402,7 @@ var Parser;
|
|
|
34377
34402
|
return result;
|
|
34378
34403
|
} else {
|
|
34379
34404
|
const statements = createMissingList();
|
|
34380
|
-
return withJSDoc(finishNode(
|
|
34405
|
+
return withJSDoc(finishNode(factoryCreateBlock(
|
|
34381
34406
|
statements,
|
|
34382
34407
|
/*multiLine*/
|
|
34383
34408
|
void 0
|
|
@@ -34426,7 +34451,7 @@ var Parser;
|
|
|
34426
34451
|
parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition);
|
|
34427
34452
|
const thenStatement = parseStatement();
|
|
34428
34453
|
const elseStatement = parseOptional(91 /* ElseKeyword */) ? parseStatement() : void 0;
|
|
34429
|
-
return withJSDoc(finishNode(
|
|
34454
|
+
return withJSDoc(finishNode(factoryCreateIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc);
|
|
34430
34455
|
}
|
|
34431
34456
|
function parseDoStatement() {
|
|
34432
34457
|
const pos = getNodePos();
|
|
@@ -34450,7 +34475,7 @@ var Parser;
|
|
|
34450
34475
|
const expression = allowInAnd(parseExpression);
|
|
34451
34476
|
parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition);
|
|
34452
34477
|
const statement = parseStatement();
|
|
34453
|
-
return withJSDoc(finishNode(
|
|
34478
|
+
return withJSDoc(finishNode(factoryCreateWhileStatement(expression, statement), pos), hasJSDoc);
|
|
34454
34479
|
}
|
|
34455
34480
|
function parseForOrForInOrForOfStatement() {
|
|
34456
34481
|
const pos = getNodePos();
|
|
@@ -34476,7 +34501,7 @@ var Parser;
|
|
|
34476
34501
|
true
|
|
34477
34502
|
));
|
|
34478
34503
|
parseExpected(21 /* CloseParenToken */);
|
|
34479
|
-
node =
|
|
34504
|
+
node = factoryCreateForOfStatement(awaitToken, initializer, expression, parseStatement());
|
|
34480
34505
|
} else if (parseOptional(101 /* InKeyword */)) {
|
|
34481
34506
|
const expression = allowInAnd(parseExpression);
|
|
34482
34507
|
parseExpected(21 /* CloseParenToken */);
|
|
@@ -34487,7 +34512,7 @@ var Parser;
|
|
|
34487
34512
|
parseExpected(26 /* SemicolonToken */);
|
|
34488
34513
|
const incrementor = token() !== 21 /* CloseParenToken */ ? allowInAnd(parseExpression) : void 0;
|
|
34489
34514
|
parseExpected(21 /* CloseParenToken */);
|
|
34490
|
-
node =
|
|
34515
|
+
node = factoryCreateForStatement(initializer, condition, incrementor, parseStatement());
|
|
34491
34516
|
}
|
|
34492
34517
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
34493
34518
|
}
|
|
@@ -34562,7 +34587,7 @@ var Parser;
|
|
|
34562
34587
|
let expression = scanner2.hasPrecedingLineBreak() ? void 0 : allowInAnd(parseExpression);
|
|
34563
34588
|
if (expression === void 0) {
|
|
34564
34589
|
identifierCount++;
|
|
34565
|
-
expression = finishNode(
|
|
34590
|
+
expression = finishNode(factoryCreateIdentifier(""), getNodePos());
|
|
34566
34591
|
}
|
|
34567
34592
|
if (!tryParseSemicolon()) {
|
|
34568
34593
|
parseErrorForMissingSemicolonAfter(expression);
|
|
@@ -34623,7 +34648,7 @@ var Parser;
|
|
|
34623
34648
|
if (!tryParseSemicolon()) {
|
|
34624
34649
|
parseErrorForMissingSemicolonAfter(expression);
|
|
34625
34650
|
}
|
|
34626
|
-
node =
|
|
34651
|
+
node = factoryCreateExpressionStatement(expression);
|
|
34627
34652
|
if (hasParen) {
|
|
34628
34653
|
hasJSDoc = false;
|
|
34629
34654
|
}
|
|
@@ -35021,7 +35046,7 @@ var Parser;
|
|
|
35021
35046
|
}
|
|
35022
35047
|
const type = parseTypeAnnotation();
|
|
35023
35048
|
const initializer = isInOrOfKeyword(token()) ? void 0 : parseInitializer();
|
|
35024
|
-
const node =
|
|
35049
|
+
const node = factoryCreateVariableDeclaration(name, exclamationToken, type, initializer);
|
|
35025
35050
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
35026
35051
|
}
|
|
35027
35052
|
function parseVariableDeclarationList(inForStatementInitializer) {
|
|
@@ -35052,7 +35077,7 @@ var Parser;
|
|
|
35052
35077
|
);
|
|
35053
35078
|
setDisallowInContext(savedDisallowIn);
|
|
35054
35079
|
}
|
|
35055
|
-
return finishNode(
|
|
35080
|
+
return finishNode(factoryCreateVariableDeclarationList(declarations, flags), pos);
|
|
35056
35081
|
}
|
|
35057
35082
|
function canFollowContextualOfKeyword() {
|
|
35058
35083
|
return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */;
|
|
@@ -35063,7 +35088,7 @@ var Parser;
|
|
|
35063
35088
|
false
|
|
35064
35089
|
);
|
|
35065
35090
|
parseSemicolon();
|
|
35066
|
-
const node =
|
|
35091
|
+
const node = factoryCreateVariableStatement(modifiers, declarationList);
|
|
35067
35092
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
35068
35093
|
}
|
|
35069
35094
|
function parseFunctionDeclaration(pos, hasJSDoc, modifiers) {
|
|
@@ -35292,7 +35317,7 @@ var Parser;
|
|
|
35292
35317
|
return void 0;
|
|
35293
35318
|
}
|
|
35294
35319
|
}
|
|
35295
|
-
return finishNode(
|
|
35320
|
+
return finishNode(factoryCreateToken(kind), pos);
|
|
35296
35321
|
}
|
|
35297
35322
|
function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) {
|
|
35298
35323
|
const pos = getNodePos();
|
|
@@ -35329,7 +35354,7 @@ var Parser;
|
|
|
35329
35354
|
if (token() === 132 /* AsyncKeyword */) {
|
|
35330
35355
|
const pos = getNodePos();
|
|
35331
35356
|
nextToken();
|
|
35332
|
-
const modifier = finishNode(
|
|
35357
|
+
const modifier = finishNode(factoryCreateToken(132 /* AsyncKeyword */), pos);
|
|
35333
35358
|
modifiers = createNodeArray([modifier], pos);
|
|
35334
35359
|
}
|
|
35335
35360
|
return modifiers;
|
|
@@ -35916,7 +35941,7 @@ var Parser;
|
|
|
35916
35941
|
/*isDeclarationFile*/
|
|
35917
35942
|
false,
|
|
35918
35943
|
[],
|
|
35919
|
-
|
|
35944
|
+
factoryCreateToken(1 /* EndOfFileToken */),
|
|
35920
35945
|
0 /* None */,
|
|
35921
35946
|
noop
|
|
35922
35947
|
);
|
|
@@ -36577,7 +36602,7 @@ var Parser;
|
|
|
36577
36602
|
let node = parseJSDocIdentifierName();
|
|
36578
36603
|
while (parseOptional(24 /* DotToken */)) {
|
|
36579
36604
|
const name = parseJSDocIdentifierName();
|
|
36580
|
-
node = finishNode(
|
|
36605
|
+
node = finishNode(factoryCreatePropertyAccessExpression(node, name), pos);
|
|
36581
36606
|
}
|
|
36582
36607
|
return node;
|
|
36583
36608
|
}
|
|
@@ -36868,7 +36893,7 @@ var Parser;
|
|
|
36868
36893
|
const end2 = scanner2.getTextPos();
|
|
36869
36894
|
const originalKeywordKind = token();
|
|
36870
36895
|
const text = internIdentifier(scanner2.getTokenValue());
|
|
36871
|
-
const result = finishNode(
|
|
36896
|
+
const result = finishNode(factoryCreateIdentifier(text, originalKeywordKind), pos, end2);
|
|
36872
36897
|
nextTokenJSDoc();
|
|
36873
36898
|
return result;
|
|
36874
36899
|
}
|
|
@@ -41166,10 +41191,13 @@ function getNodeResolutionFeatures(options) {
|
|
|
41166
41191
|
return features;
|
|
41167
41192
|
}
|
|
41168
41193
|
function getConditions(options, esmMode) {
|
|
41169
|
-
const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["
|
|
41194
|
+
const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["import"] : ["require"];
|
|
41170
41195
|
if (!options.noDtsResolution) {
|
|
41171
41196
|
conditions.push("types");
|
|
41172
41197
|
}
|
|
41198
|
+
if (getEmitModuleResolutionKind(options) !== 100 /* Bundler */) {
|
|
41199
|
+
conditions.push("node");
|
|
41200
|
+
}
|
|
41173
41201
|
return concatenate(conditions, options.customConditions);
|
|
41174
41202
|
}
|
|
41175
41203
|
function resolvePackageNameToPackageJson(packageName, containingDirectory, options, host, cache) {
|
|
@@ -41896,7 +41924,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
41896
41924
|
isConfigLookup,
|
|
41897
41925
|
candidateIsFromPackageJsonField: false
|
|
41898
41926
|
};
|
|
41899
|
-
if (traceEnabled &&
|
|
41927
|
+
if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(getEmitModuleResolutionKind(compilerOptions))) {
|
|
41900
41928
|
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
41901
41929
|
}
|
|
41902
41930
|
let result;
|
|
@@ -50410,7 +50438,9 @@ function createTypeChecker(host) {
|
|
|
50410
50438
|
function getSuggestedImportSource(tsExtension) {
|
|
50411
50439
|
const importSourceWithoutExtension = removeExtension(moduleReference, tsExtension);
|
|
50412
50440
|
if (emitModuleKindIsNonNodeESM(moduleKind) || mode === 99 /* ESNext */) {
|
|
50413
|
-
|
|
50441
|
+
const preferTs = isDeclarationFileName(moduleReference) && shouldAllowImportingTsExtension(compilerOptions);
|
|
50442
|
+
const ext = tsExtension === ".mts" /* Mts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".mts" : ".mjs" : tsExtension === ".cts" /* Cts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".cts" : ".cjs" : preferTs ? ".ts" : ".js";
|
|
50443
|
+
return importSourceWithoutExtension + ext;
|
|
50414
50444
|
}
|
|
50415
50445
|
return importSourceWithoutExtension;
|
|
50416
50446
|
}
|
|
@@ -66234,7 +66264,7 @@ function createTypeChecker(host) {
|
|
|
66234
66264
|
return type.symbol;
|
|
66235
66265
|
}
|
|
66236
66266
|
if (isTupleType(type)) {
|
|
66237
|
-
return type
|
|
66267
|
+
return type;
|
|
66238
66268
|
}
|
|
66239
66269
|
}
|
|
66240
66270
|
if (type.flags & 262144 /* TypeParameter */) {
|
|
@@ -83403,8 +83433,6 @@ function createTypeChecker(host) {
|
|
|
83403
83433
|
} else {
|
|
83404
83434
|
if (moduleKind >= 5 /* ES2015 */ && getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 16777216 /* Ambient */)) {
|
|
83405
83435
|
grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
|
|
83406
|
-
} else if (!(node.flags & 16777216 /* Ambient */) && getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) {
|
|
83407
|
-
grammarErrorOnNode(node, Diagnostics.Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
|
|
83408
83436
|
}
|
|
83409
83437
|
}
|
|
83410
83438
|
}
|
|
@@ -83611,8 +83639,6 @@ function createTypeChecker(host) {
|
|
|
83611
83639
|
grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead);
|
|
83612
83640
|
} else if (moduleKind === 4 /* System */ && !(node.flags & 16777216 /* Ambient */)) {
|
|
83613
83641
|
grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system);
|
|
83614
|
-
} else if (getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */ && !(node.flags & 16777216 /* Ambient */)) {
|
|
83615
|
-
grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead);
|
|
83616
83642
|
}
|
|
83617
83643
|
}
|
|
83618
83644
|
}
|
|
@@ -120087,10 +120113,10 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120087
120113
|
}
|
|
120088
120114
|
}
|
|
120089
120115
|
if (options.preserveValueImports && getEmitModuleKind(options) < 5 /* ES2015 */) {
|
|
120090
|
-
createDiagnosticForOptionName(Diagnostics.
|
|
120116
|
+
createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports");
|
|
120091
120117
|
}
|
|
120118
|
+
const moduleKind = getEmitModuleKind(options);
|
|
120092
120119
|
if (options.verbatimModuleSyntax) {
|
|
120093
|
-
const moduleKind = getEmitModuleKind(options);
|
|
120094
120120
|
if (moduleKind === 2 /* AMD */ || moduleKind === 3 /* UMD */ || moduleKind === 4 /* System */) {
|
|
120095
120121
|
createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax");
|
|
120096
120122
|
}
|
|
@@ -120109,13 +120135,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120109
120135
|
}
|
|
120110
120136
|
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
120111
120137
|
if (options.resolvePackageJsonExports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
120112
|
-
|
|
120138
|
+
createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonExports");
|
|
120113
120139
|
}
|
|
120114
120140
|
if (options.resolvePackageJsonImports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
120115
|
-
|
|
120141
|
+
createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonImports");
|
|
120116
120142
|
}
|
|
120117
120143
|
if (options.customConditions && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
120118
|
-
|
|
120144
|
+
createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions");
|
|
120145
|
+
}
|
|
120146
|
+
if (moduleResolution === 100 /* Bundler */ && !emitModuleKindIsNonNodeESM(moduleKind)) {
|
|
120147
|
+
createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "bundler");
|
|
120119
120148
|
}
|
|
120120
120149
|
if (!options.noEmit && !options.suppressOutputPathCheck) {
|
|
120121
120150
|
const emitHost = getEmitHost();
|
|
@@ -148295,7 +148324,6 @@ var CompletionSource = /* @__PURE__ */ ((CompletionSource2) => {
|
|
|
148295
148324
|
CompletionSource2["TypeOnlyAlias"] = "TypeOnlyAlias/";
|
|
148296
148325
|
CompletionSource2["ObjectLiteralMethodSnippet"] = "ObjectLiteralMethodSnippet/";
|
|
148297
148326
|
CompletionSource2["SwitchCases"] = "SwitchCases/";
|
|
148298
|
-
CompletionSource2["ObjectLiteralExpression"] = "ObjectLiteralExpression/";
|
|
148299
148327
|
return CompletionSource2;
|
|
148300
148328
|
})(CompletionSource || {});
|
|
148301
148329
|
var SymbolOriginInfoKind = /* @__PURE__ */ ((SymbolOriginInfoKind2) => {
|
|
@@ -148893,7 +148921,6 @@ function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
|
|
|
148893
148921
|
return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority };
|
|
148894
148922
|
}
|
|
148895
148923
|
function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) {
|
|
148896
|
-
var _a2;
|
|
148897
148924
|
let insertText;
|
|
148898
148925
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
148899
148926
|
let data;
|
|
@@ -148951,10 +148978,6 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
148951
148978
|
if ((origin == null ? void 0 : origin.kind) === 64 /* TypeOnlyAlias */) {
|
|
148952
148979
|
hasAction = true;
|
|
148953
148980
|
}
|
|
148954
|
-
if (contextToken && isPropertyAssignment(contextToken.parent) && ((_a2 = findNextToken(contextToken, contextToken == null ? void 0 : contextToken.parent, sourceFile)) == null ? void 0 : _a2.kind) !== 27 /* CommaToken */ && completionKind === 0 /* ObjectPropertyDeclaration */) {
|
|
148955
|
-
source = "ObjectLiteralExpression/" /* ObjectLiteralExpression */;
|
|
148956
|
-
hasAction = true;
|
|
148957
|
-
}
|
|
148958
148981
|
if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
148959
148982
|
let importAdder;
|
|
148960
148983
|
({ insertText, isSnippet, importAdder, replacementSpan } = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext));
|
|
@@ -149643,7 +149666,7 @@ function getSymbolCompletionFromEntryId(program, log, sourceFile, position, entr
|
|
|
149643
149666
|
return firstDefined(symbols, (symbol, index) => {
|
|
149644
149667
|
const origin = symbolToOriginInfoMap[index];
|
|
149645
149668
|
const info = getCompletionEntryDisplayNameForSymbol(symbol, getEmitScriptTarget(compilerOptions), origin, completionKind, completionData.isJsxIdentifierExpected);
|
|
149646
|
-
return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source
|
|
149669
|
+
return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source) ? { type: "symbol", symbol, location, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0;
|
|
149647
149670
|
}) || { type: "none" };
|
|
149648
149671
|
}
|
|
149649
149672
|
function getCompletionEntryDetails(program, log, sourceFile, position, entryId, host, formatContext, preferences, cancellationToken) {
|
|
@@ -149781,21 +149804,6 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
|
|
|
149781
149804
|
Debug.assertIsDefined(codeAction2, "Expected to have a code action for promoting type-only alias");
|
|
149782
149805
|
return { codeActions: [codeAction2], sourceDisplay: void 0 };
|
|
149783
149806
|
}
|
|
149784
|
-
if (source === "ObjectLiteralExpression/" /* ObjectLiteralExpression */ && contextToken) {
|
|
149785
|
-
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
149786
|
-
{ host, formatContext, preferences },
|
|
149787
|
-
(tracker) => tracker.insertText(sourceFile, contextToken.end, ",")
|
|
149788
|
-
);
|
|
149789
|
-
if (changes) {
|
|
149790
|
-
return {
|
|
149791
|
-
sourceDisplay: void 0,
|
|
149792
|
-
codeActions: [{
|
|
149793
|
-
changes,
|
|
149794
|
-
description: diagnosticToString([Diagnostics.Add_missing_comma_for_an_object_member_completion_0, name])
|
|
149795
|
-
}]
|
|
149796
|
-
};
|
|
149797
|
-
}
|
|
149798
|
-
}
|
|
149799
149807
|
if (!origin || !(originIsExport(origin) || originIsResolvedExport(origin))) {
|
|
149800
149808
|
return { codeActions: void 0, sourceDisplay: void 0 };
|
|
149801
149809
|
}
|
|
@@ -151203,10 +151211,6 @@ function tryGetObjectLikeCompletionContainer(contextToken) {
|
|
|
151203
151211
|
return isMethodDeclaration(parent2) ? tryCast(parent2.parent, isObjectLiteralExpression) : void 0;
|
|
151204
151212
|
case 79 /* Identifier */:
|
|
151205
151213
|
return contextToken.text === "async" && isShorthandPropertyAssignment(contextToken.parent) ? contextToken.parent.parent : void 0;
|
|
151206
|
-
default:
|
|
151207
|
-
if (parent2.parent && isObjectLiteralExpression(parent2.parent) && contextToken.kind !== 58 /* ColonToken */) {
|
|
151208
|
-
return parent2.parent;
|
|
151209
|
-
}
|
|
151210
151214
|
}
|
|
151211
151215
|
}
|
|
151212
151216
|
return void 0;
|
|
@@ -163900,10 +163904,6 @@ var ChangeTracker = class {
|
|
|
163900
163904
|
const suffix = this.nextCommaToken(sourceFile, oldNode) ? "" : "," + this.newLineCharacter;
|
|
163901
163905
|
this.replaceNode(sourceFile, oldNode, newNode, { suffix });
|
|
163902
163906
|
}
|
|
163903
|
-
replacePropertyAssignmentOnSameLine(sourceFile, oldNode, newNode) {
|
|
163904
|
-
const suffix = this.nextCommaToken(sourceFile, oldNode) ? "" : ",";
|
|
163905
|
-
this.replaceNode(sourceFile, oldNode, newNode, { suffix });
|
|
163906
|
-
}
|
|
163907
163907
|
insertNodeAt(sourceFile, pos, newNode, options = {}) {
|
|
163908
163908
|
this.replaceRange(sourceFile, createRange(pos), newNode, options);
|
|
163909
163909
|
}
|