@typescript-deploys/pr-build 5.0.0-pr-52450-10 → 5.0.0-pr-52525-3
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 +16 -12
- package/lib/tsserver.js +73 -35
- package/lib/tsserverlibrary.d.ts +6 -0
- package/lib/tsserverlibrary.js +74 -43
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +72 -43
- package/lib/typingsInstaller.js +13 -9
- 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-insiders.
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20230130`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -6980,7 +6980,7 @@ var Diagnostics = {
|
|
|
6980
6980
|
Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."),
|
|
6981
6981
|
Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."),
|
|
6982
6982
|
File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."),
|
|
6983
|
-
|
|
6983
|
+
File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."),
|
|
6984
6984
|
Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."),
|
|
6985
6985
|
Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."),
|
|
6986
6986
|
package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."),
|
|
@@ -28556,7 +28556,7 @@ var Parser;
|
|
|
28556
28556
|
return Tristate.False;
|
|
28557
28557
|
}
|
|
28558
28558
|
if (languageVariant === 1 /* JSX */) {
|
|
28559
|
-
|
|
28559
|
+
const isArrowFunctionInJsx = lookAhead(() => {
|
|
28560
28560
|
parseOptional(85 /* ConstKeyword */);
|
|
28561
28561
|
const third = nextToken();
|
|
28562
28562
|
if (third === 94 /* ExtendsKeyword */) {
|
|
@@ -28564,15 +28564,19 @@ var Parser;
|
|
|
28564
28564
|
switch (fourth) {
|
|
28565
28565
|
case 63 /* EqualsToken */:
|
|
28566
28566
|
case 31 /* GreaterThanToken */:
|
|
28567
|
-
return
|
|
28567
|
+
return false;
|
|
28568
28568
|
default:
|
|
28569
|
-
return
|
|
28569
|
+
return true;
|
|
28570
28570
|
}
|
|
28571
28571
|
} else if (third === 27 /* CommaToken */ || third === 63 /* EqualsToken */) {
|
|
28572
|
-
return
|
|
28572
|
+
return true;
|
|
28573
28573
|
}
|
|
28574
|
-
return
|
|
28574
|
+
return false;
|
|
28575
28575
|
});
|
|
28576
|
+
if (isArrowFunctionInJsx) {
|
|
28577
|
+
return Tristate.True;
|
|
28578
|
+
}
|
|
28579
|
+
return Tristate.False;
|
|
28576
28580
|
}
|
|
28577
28581
|
return Tristate.Unknown;
|
|
28578
28582
|
}
|
|
@@ -37267,7 +37271,7 @@ function tryFileLookup(fileName, onlyRecordFailures, state) {
|
|
|
37267
37271
|
if (!onlyRecordFailures) {
|
|
37268
37272
|
if (state.host.fileExists(fileName)) {
|
|
37269
37273
|
if (state.traceEnabled) {
|
|
37270
|
-
trace(state.host, Diagnostics.
|
|
37274
|
+
trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName);
|
|
37271
37275
|
}
|
|
37272
37276
|
return fileName;
|
|
37273
37277
|
} else {
|
|
@@ -64450,7 +64454,7 @@ function createTypeChecker(host) {
|
|
|
64450
64454
|
return narrowTypeByLiteralExpression(type, literal, assumeTrue);
|
|
64451
64455
|
}
|
|
64452
64456
|
function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
|
|
64453
|
-
return assumeTrue ? narrowTypeByTypeName(type, literal.text) :
|
|
64457
|
+
return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
|
|
64454
64458
|
}
|
|
64455
64459
|
function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
|
|
64456
64460
|
const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
|
|
@@ -78283,7 +78287,7 @@ function createTypeChecker(host) {
|
|
|
78283
78287
|
const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */);
|
|
78284
78288
|
if (node.expression.kind === 79 /* Identifier */) {
|
|
78285
78289
|
const id = node.expression;
|
|
78286
|
-
const sym = resolveEntityName(
|
|
78290
|
+
const sym = getExportSymbolOfValueSymbolIfExported(resolveEntityName(
|
|
78287
78291
|
id,
|
|
78288
78292
|
67108863 /* All */,
|
|
78289
78293
|
/*ignoreErrors*/
|
|
@@ -78291,7 +78295,7 @@ function createTypeChecker(host) {
|
|
|
78291
78295
|
/*dontResolveAlias*/
|
|
78292
78296
|
true,
|
|
78293
78297
|
node
|
|
78294
|
-
);
|
|
78298
|
+
));
|
|
78295
78299
|
if (sym) {
|
|
78296
78300
|
markAliasReferenced(sym, id);
|
|
78297
78301
|
if (getAllSymbolFlags(sym) & 111551 /* Value */) {
|
|
@@ -83306,7 +83310,7 @@ var visitEachChildTable = {
|
|
|
83306
83310
|
[291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
83307
83311
|
return context.factory.updateJsxExpression(
|
|
83308
83312
|
node,
|
|
83309
|
-
|
|
83313
|
+
nodeVisitor(node.expression, visitor, isExpression)
|
|
83310
83314
|
);
|
|
83311
83315
|
},
|
|
83312
83316
|
// Clauses
|
package/lib/tsserver.js
CHANGED
|
@@ -2378,7 +2378,7 @@ __export(ts_server_exports3, {
|
|
|
2378
2378
|
|
|
2379
2379
|
// src/compiler/corePublic.ts
|
|
2380
2380
|
var versionMajorMinor = "5.0";
|
|
2381
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2381
|
+
var version = `${versionMajorMinor}.0-insiders.20230130`;
|
|
2382
2382
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2383
2383
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2384
2384
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -10535,7 +10535,7 @@ var Diagnostics = {
|
|
|
10535
10535
|
Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."),
|
|
10536
10536
|
Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."),
|
|
10537
10537
|
File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."),
|
|
10538
|
-
|
|
10538
|
+
File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."),
|
|
10539
10539
|
Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."),
|
|
10540
10540
|
Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."),
|
|
10541
10541
|
package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."),
|
|
@@ -32966,7 +32966,7 @@ var Parser;
|
|
|
32966
32966
|
return Tristate.False;
|
|
32967
32967
|
}
|
|
32968
32968
|
if (languageVariant === 1 /* JSX */) {
|
|
32969
|
-
|
|
32969
|
+
const isArrowFunctionInJsx = lookAhead(() => {
|
|
32970
32970
|
parseOptional(85 /* ConstKeyword */);
|
|
32971
32971
|
const third = nextToken();
|
|
32972
32972
|
if (third === 94 /* ExtendsKeyword */) {
|
|
@@ -32974,15 +32974,19 @@ var Parser;
|
|
|
32974
32974
|
switch (fourth) {
|
|
32975
32975
|
case 63 /* EqualsToken */:
|
|
32976
32976
|
case 31 /* GreaterThanToken */:
|
|
32977
|
-
return
|
|
32977
|
+
return false;
|
|
32978
32978
|
default:
|
|
32979
|
-
return
|
|
32979
|
+
return true;
|
|
32980
32980
|
}
|
|
32981
32981
|
} else if (third === 27 /* CommaToken */ || third === 63 /* EqualsToken */) {
|
|
32982
|
-
return
|
|
32982
|
+
return true;
|
|
32983
32983
|
}
|
|
32984
|
-
return
|
|
32984
|
+
return false;
|
|
32985
32985
|
});
|
|
32986
|
+
if (isArrowFunctionInJsx) {
|
|
32987
|
+
return Tristate.True;
|
|
32988
|
+
}
|
|
32989
|
+
return Tristate.False;
|
|
32986
32990
|
}
|
|
32987
32991
|
return Tristate.Unknown;
|
|
32988
32992
|
}
|
|
@@ -41770,7 +41774,7 @@ function tryFileLookup(fileName, onlyRecordFailures, state) {
|
|
|
41770
41774
|
if (!onlyRecordFailures) {
|
|
41771
41775
|
if (state.host.fileExists(fileName)) {
|
|
41772
41776
|
if (state.traceEnabled) {
|
|
41773
|
-
trace(state.host, Diagnostics.
|
|
41777
|
+
trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName);
|
|
41774
41778
|
}
|
|
41775
41779
|
return fileName;
|
|
41776
41780
|
} else {
|
|
@@ -69108,7 +69112,7 @@ function createTypeChecker(host) {
|
|
|
69108
69112
|
return narrowTypeByLiteralExpression(type, literal, assumeTrue);
|
|
69109
69113
|
}
|
|
69110
69114
|
function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
|
|
69111
|
-
return assumeTrue ? narrowTypeByTypeName(type, literal.text) :
|
|
69115
|
+
return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
|
|
69112
69116
|
}
|
|
69113
69117
|
function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
|
|
69114
69118
|
const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
|
|
@@ -82941,7 +82945,7 @@ function createTypeChecker(host) {
|
|
|
82941
82945
|
const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */);
|
|
82942
82946
|
if (node.expression.kind === 79 /* Identifier */) {
|
|
82943
82947
|
const id = node.expression;
|
|
82944
|
-
const sym = resolveEntityName(
|
|
82948
|
+
const sym = getExportSymbolOfValueSymbolIfExported(resolveEntityName(
|
|
82945
82949
|
id,
|
|
82946
82950
|
67108863 /* All */,
|
|
82947
82951
|
/*ignoreErrors*/
|
|
@@ -82949,7 +82953,7 @@ function createTypeChecker(host) {
|
|
|
82949
82953
|
/*dontResolveAlias*/
|
|
82950
82954
|
true,
|
|
82951
82955
|
node
|
|
82952
|
-
);
|
|
82956
|
+
));
|
|
82953
82957
|
if (sym) {
|
|
82954
82958
|
markAliasReferenced(sym, id);
|
|
82955
82959
|
if (getAllSymbolFlags(sym) & 111551 /* Value */) {
|
|
@@ -87964,7 +87968,7 @@ var visitEachChildTable = {
|
|
|
87964
87968
|
[291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
87965
87969
|
return context.factory.updateJsxExpression(
|
|
87966
87970
|
node,
|
|
87967
|
-
|
|
87971
|
+
nodeVisitor(node.expression, visitor, isExpression)
|
|
87968
87972
|
);
|
|
87969
87973
|
},
|
|
87970
87974
|
// Clauses
|
|
@@ -148184,7 +148188,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
|
|
|
148184
148188
|
false
|
|
148185
148189
|
);
|
|
148186
148190
|
const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
|
|
148187
|
-
let modifierFlags = effectiveModifierFlags &
|
|
148191
|
+
let modifierFlags = effectiveModifierFlags & 32 /* Static */;
|
|
148192
|
+
modifierFlags |= effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
|
|
148188
148193
|
if (declaration && isAutoAccessorPropertyDeclaration(declaration)) {
|
|
148189
148194
|
modifierFlags |= 128 /* Accessor */;
|
|
148190
148195
|
}
|
|
@@ -150527,6 +150532,7 @@ function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
|
|
|
150527
150532
|
}
|
|
150528
150533
|
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) {
|
|
150529
150534
|
let insertText;
|
|
150535
|
+
let filterText;
|
|
150530
150536
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
150531
150537
|
let data;
|
|
150532
150538
|
let isSnippet;
|
|
@@ -150583,11 +150589,15 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
150583
150589
|
}
|
|
150584
150590
|
if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === CompletionKind.MemberLike && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
150585
150591
|
let importAdder;
|
|
150586
|
-
|
|
150587
|
-
|
|
150588
|
-
|
|
150589
|
-
|
|
150590
|
-
|
|
150592
|
+
const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
|
|
150593
|
+
if (memberCompletionEntry) {
|
|
150594
|
+
({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
|
|
150595
|
+
if (importAdder == null ? void 0 : importAdder.hasFixes()) {
|
|
150596
|
+
hasAction = true;
|
|
150597
|
+
source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
|
|
150598
|
+
}
|
|
150599
|
+
} else {
|
|
150600
|
+
return void 0;
|
|
150591
150601
|
}
|
|
150592
150602
|
}
|
|
150593
150603
|
if (origin && originIsObjectLiteralMethod(origin)) {
|
|
@@ -150631,6 +150641,7 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
150631
150641
|
hasAction: hasAction ? true : void 0,
|
|
150632
150642
|
isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0,
|
|
150633
150643
|
insertText,
|
|
150644
|
+
filterText,
|
|
150634
150645
|
replacementSpan,
|
|
150635
150646
|
sourceDisplay,
|
|
150636
150647
|
labelDetails,
|
|
@@ -150648,13 +150659,14 @@ function isClassLikeMemberCompletion(symbol, location, sourceFile) {
|
|
|
150648
150659
|
return !!(symbol.flags & memberFlags) && (isClassLike(location) || location.parent && location.parent.parent && isClassElement(location.parent) && location === location.parent.name && location.parent.getLastToken(sourceFile) === location.parent.name && isClassLike(location.parent.parent) || location.parent && isSyntaxList(location) && isClassLike(location.parent));
|
|
150649
150660
|
}
|
|
150650
150661
|
function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) {
|
|
150662
|
+
var _a2;
|
|
150651
150663
|
const classLikeDeclaration = findAncestor(location, isClassLike);
|
|
150652
150664
|
if (!classLikeDeclaration) {
|
|
150653
|
-
return
|
|
150665
|
+
return void 0;
|
|
150654
150666
|
}
|
|
150655
150667
|
let isSnippet;
|
|
150656
|
-
let replacementSpan;
|
|
150657
150668
|
let insertText = name;
|
|
150669
|
+
const filterText = name;
|
|
150658
150670
|
const checker = program.getTypeChecker();
|
|
150659
150671
|
const sourceFile = location.getSourceFile();
|
|
150660
150672
|
const printer = createSnippetPrinter({
|
|
@@ -150683,9 +150695,9 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
150683
150695
|
);
|
|
150684
150696
|
}
|
|
150685
150697
|
let modifiers = 0 /* None */;
|
|
150686
|
-
const { modifiers: presentModifiers,
|
|
150687
|
-
const isAbstract =
|
|
150688
|
-
|
|
150698
|
+
const { modifiers: presentModifiers, modifierList: presentModifiersList } = getPresentModifiers(contextToken, sourceFile, position);
|
|
150699
|
+
const isAbstract = presentModifiers & 256 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 256 /* Abstract */;
|
|
150700
|
+
let completionNodes = [];
|
|
150689
150701
|
ts_codefix_exports.addNewNodeForMemberSymbol(
|
|
150690
150702
|
symbol,
|
|
150691
150703
|
classLikeDeclaration,
|
|
@@ -150709,18 +150721,38 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
150709
150721
|
requiredModifiers |= 16384 /* Override */;
|
|
150710
150722
|
}
|
|
150711
150723
|
if (!completionNodes.length) {
|
|
150712
|
-
modifiers = node.modifierFlagsCache | requiredModifiers
|
|
150724
|
+
modifiers = node.modifierFlagsCache | requiredModifiers;
|
|
150713
150725
|
}
|
|
150714
150726
|
node = factory.updateModifiers(node, modifiers);
|
|
150715
150727
|
completionNodes.push(node);
|
|
150716
150728
|
},
|
|
150717
150729
|
body,
|
|
150718
150730
|
ts_codefix_exports.PreserveOptionalFlags.Property,
|
|
150719
|
-
isAbstract
|
|
150731
|
+
!!isAbstract
|
|
150720
150732
|
);
|
|
150721
150733
|
if (completionNodes.length) {
|
|
150734
|
+
const isMethod = symbol.flags & 8192 /* Method */;
|
|
150735
|
+
let allowedModifiers = modifiers | 16384 /* Override */ | 4 /* Public */;
|
|
150736
|
+
if (!isMethod) {
|
|
150737
|
+
allowedModifiers |= 2 /* Ambient */ | 64 /* Readonly */;
|
|
150738
|
+
}
|
|
150739
|
+
const allowedAndPresent = presentModifiers & allowedModifiers;
|
|
150740
|
+
if (modifiers & 16 /* Protected */ && allowedAndPresent & 4 /* Public */) {
|
|
150741
|
+
modifiers &= ~16 /* Protected */;
|
|
150742
|
+
}
|
|
150743
|
+
if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 4 /* Public */)) {
|
|
150744
|
+
modifiers &= ~4 /* Public */;
|
|
150745
|
+
}
|
|
150746
|
+
modifiers |= allowedAndPresent;
|
|
150747
|
+
completionNodes = completionNodes.map((node) => factory.updateModifiers(node, modifiers));
|
|
150748
|
+
const modifiersInsertList = factory.createModifiersFromModifierFlags(modifiers);
|
|
150749
|
+
for (let i = 0; i < presentModifiersList.length; i++) {
|
|
150750
|
+
if (presentModifiersList[i].kind !== ((_a2 = modifiersInsertList == null ? void 0 : modifiersInsertList[i]) == null ? void 0 : _a2.kind)) {
|
|
150751
|
+
return void 0;
|
|
150752
|
+
}
|
|
150753
|
+
}
|
|
150754
|
+
completionNodes[0] = factory.updateModifiers(completionNodes[0], modifiers & ~presentModifiers);
|
|
150722
150755
|
const format = 1 /* MultiLine */ | 131072 /* NoTrailingNewLine */;
|
|
150723
|
-
replacementSpan = modifiersSpan;
|
|
150724
150756
|
if (formatContext) {
|
|
150725
150757
|
insertText = printer.printAndFormatSnippetList(
|
|
150726
150758
|
format,
|
|
@@ -150736,24 +150768,28 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
150736
150768
|
);
|
|
150737
150769
|
}
|
|
150738
150770
|
}
|
|
150739
|
-
return { insertText, isSnippet, importAdder
|
|
150771
|
+
return { insertText, filterText, isSnippet, importAdder };
|
|
150740
150772
|
}
|
|
150741
150773
|
function getPresentModifiers(contextToken, sourceFile, position) {
|
|
150774
|
+
var _a2;
|
|
150742
150775
|
if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) {
|
|
150743
|
-
return { modifiers: 0 /* None
|
|
150776
|
+
return { modifiers: 0 /* None */, modifierList: [] };
|
|
150744
150777
|
}
|
|
150745
150778
|
let modifiers = 0 /* None */;
|
|
150746
|
-
let
|
|
150779
|
+
let modifierList = [];
|
|
150747
150780
|
let contextMod;
|
|
150748
|
-
if (contextMod = isModifierLike2(contextToken)) {
|
|
150749
|
-
modifiers |= modifierToFlag(contextMod);
|
|
150750
|
-
span = createTextSpanFromNode(contextToken);
|
|
150751
|
-
}
|
|
150752
150781
|
if (isPropertyDeclaration(contextToken.parent)) {
|
|
150753
150782
|
modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 126975 /* Modifier */;
|
|
150754
|
-
|
|
150783
|
+
modifierList = ((_a2 = contextToken.parent.modifiers) == null ? void 0 : _a2.filter(isModifier)) || [];
|
|
150784
|
+
}
|
|
150785
|
+
if (contextMod = isModifierLike2(contextToken)) {
|
|
150786
|
+
const contextModifierFlag = modifierToFlag(contextMod);
|
|
150787
|
+
if (!(modifiers & contextModifierFlag)) {
|
|
150788
|
+
modifierList.push(factory.createToken(contextMod));
|
|
150789
|
+
modifiers |= contextModifierFlag;
|
|
150790
|
+
}
|
|
150755
150791
|
}
|
|
150756
|
-
return { modifiers,
|
|
150792
|
+
return { modifiers, modifierList };
|
|
150757
150793
|
}
|
|
150758
150794
|
function isModifierLike2(node) {
|
|
150759
150795
|
if (isModifier(node)) {
|
|
@@ -178397,6 +178433,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
178397
178433
|
kindModifiers,
|
|
178398
178434
|
sortText,
|
|
178399
178435
|
insertText,
|
|
178436
|
+
filterText,
|
|
178400
178437
|
replacementSpan,
|
|
178401
178438
|
hasAction,
|
|
178402
178439
|
source,
|
|
@@ -178415,6 +178452,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
178415
178452
|
kindModifiers,
|
|
178416
178453
|
sortText,
|
|
178417
178454
|
insertText,
|
|
178455
|
+
filterText,
|
|
178418
178456
|
replacementSpan: convertedSpan,
|
|
178419
178457
|
isSnippet,
|
|
178420
178458
|
hasAction: hasAction || void 0,
|
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -1798,6 +1798,11 @@ declare namespace ts {
|
|
|
1798
1798
|
* coupled with `replacementSpan` to replace a dotted access with a bracket access.
|
|
1799
1799
|
*/
|
|
1800
1800
|
insertText?: string;
|
|
1801
|
+
/**
|
|
1802
|
+
* A string that should be used when filtering a set of
|
|
1803
|
+
* completion items.
|
|
1804
|
+
*/
|
|
1805
|
+
filterText?: string;
|
|
1801
1806
|
/**
|
|
1802
1807
|
* `insertText` should be interpreted as a snippet if true.
|
|
1803
1808
|
*/
|
|
@@ -10598,6 +10603,7 @@ declare namespace ts {
|
|
|
10598
10603
|
kindModifiers?: string;
|
|
10599
10604
|
sortText: string;
|
|
10600
10605
|
insertText?: string;
|
|
10606
|
+
filterText?: string;
|
|
10601
10607
|
isSnippet?: true;
|
|
10602
10608
|
/**
|
|
10603
10609
|
* An optional span that indicates the text to be replaced by this completion item.
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -18,17 +18,10 @@ and limitations under the License.
|
|
|
18
18
|
var ts = (() => {
|
|
19
19
|
var __defProp = Object.defineProperty;
|
|
20
20
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
21
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
22
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
23
|
-
}) : x)(function(x) {
|
|
24
|
-
if (typeof require !== "undefined")
|
|
25
|
-
return require.apply(this, arguments);
|
|
26
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
27
|
-
});
|
|
28
21
|
var __esm = (fn, res) => function __init() {
|
|
29
22
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
30
23
|
};
|
|
31
|
-
var __commonJS = (cb, mod) => function
|
|
24
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
32
25
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
33
26
|
};
|
|
34
27
|
var __export = (target, all) => {
|
|
@@ -42,7 +35,7 @@ var ts = (() => {
|
|
|
42
35
|
"src/compiler/corePublic.ts"() {
|
|
43
36
|
"use strict";
|
|
44
37
|
versionMajorMinor = "5.0";
|
|
45
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230130`;
|
|
46
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
47
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
48
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -8274,7 +8267,7 @@ ${lanes.join("\n")}
|
|
|
8274
8267
|
Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."),
|
|
8275
8268
|
Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."),
|
|
8276
8269
|
File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."),
|
|
8277
|
-
|
|
8270
|
+
File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."),
|
|
8278
8271
|
Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."),
|
|
8279
8272
|
Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."),
|
|
8280
8273
|
package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."),
|
|
@@ -30993,7 +30986,7 @@ ${lanes.join("\n")}
|
|
|
30993
30986
|
return Tristate.False;
|
|
30994
30987
|
}
|
|
30995
30988
|
if (languageVariant === 1 /* JSX */) {
|
|
30996
|
-
|
|
30989
|
+
const isArrowFunctionInJsx = lookAhead(() => {
|
|
30997
30990
|
parseOptional(85 /* ConstKeyword */);
|
|
30998
30991
|
const third = nextToken();
|
|
30999
30992
|
if (third === 94 /* ExtendsKeyword */) {
|
|
@@ -31001,15 +30994,19 @@ ${lanes.join("\n")}
|
|
|
31001
30994
|
switch (fourth) {
|
|
31002
30995
|
case 63 /* EqualsToken */:
|
|
31003
30996
|
case 31 /* GreaterThanToken */:
|
|
31004
|
-
return
|
|
30997
|
+
return false;
|
|
31005
30998
|
default:
|
|
31006
|
-
return
|
|
30999
|
+
return true;
|
|
31007
31000
|
}
|
|
31008
31001
|
} else if (third === 27 /* CommaToken */ || third === 63 /* EqualsToken */) {
|
|
31009
|
-
return
|
|
31002
|
+
return true;
|
|
31010
31003
|
}
|
|
31011
|
-
return
|
|
31004
|
+
return false;
|
|
31012
31005
|
});
|
|
31006
|
+
if (isArrowFunctionInJsx) {
|
|
31007
|
+
return Tristate.True;
|
|
31008
|
+
}
|
|
31009
|
+
return Tristate.False;
|
|
31013
31010
|
}
|
|
31014
31011
|
return Tristate.Unknown;
|
|
31015
31012
|
}
|
|
@@ -39572,7 +39569,7 @@ ${lanes.join("\n")}
|
|
|
39572
39569
|
if (!onlyRecordFailures) {
|
|
39573
39570
|
if (state.host.fileExists(fileName)) {
|
|
39574
39571
|
if (state.traceEnabled) {
|
|
39575
|
-
trace(state.host, Diagnostics.
|
|
39572
|
+
trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName);
|
|
39576
39573
|
}
|
|
39577
39574
|
return fileName;
|
|
39578
39575
|
} else {
|
|
@@ -66834,7 +66831,7 @@ ${lanes.join("\n")}
|
|
|
66834
66831
|
return narrowTypeByLiteralExpression(type, literal, assumeTrue);
|
|
66835
66832
|
}
|
|
66836
66833
|
function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
|
|
66837
|
-
return assumeTrue ? narrowTypeByTypeName(type, literal.text) :
|
|
66834
|
+
return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
|
|
66838
66835
|
}
|
|
66839
66836
|
function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
|
|
66840
66837
|
const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
|
|
@@ -80667,7 +80664,7 @@ ${lanes.join("\n")}
|
|
|
80667
80664
|
const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */);
|
|
80668
80665
|
if (node.expression.kind === 79 /* Identifier */) {
|
|
80669
80666
|
const id = node.expression;
|
|
80670
|
-
const sym = resolveEntityName(
|
|
80667
|
+
const sym = getExportSymbolOfValueSymbolIfExported(resolveEntityName(
|
|
80671
80668
|
id,
|
|
80672
80669
|
67108863 /* All */,
|
|
80673
80670
|
/*ignoreErrors*/
|
|
@@ -80675,7 +80672,7 @@ ${lanes.join("\n")}
|
|
|
80675
80672
|
/*dontResolveAlias*/
|
|
80676
80673
|
true,
|
|
80677
80674
|
node
|
|
80678
|
-
);
|
|
80675
|
+
));
|
|
80679
80676
|
if (sym) {
|
|
80680
80677
|
markAliasReferenced(sym, id);
|
|
80681
80678
|
if (getAllSymbolFlags(sym) & 111551 /* Value */) {
|
|
@@ -85832,7 +85829,7 @@ ${lanes.join("\n")}
|
|
|
85832
85829
|
[291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
85833
85830
|
return context.factory.updateJsxExpression(
|
|
85834
85831
|
node,
|
|
85835
|
-
|
|
85832
|
+
nodeVisitor(node.expression, visitor, isExpression)
|
|
85836
85833
|
);
|
|
85837
85834
|
},
|
|
85838
85835
|
// Clauses
|
|
@@ -144631,7 +144628,8 @@ ${lanes.join("\n")}
|
|
|
144631
144628
|
false
|
|
144632
144629
|
);
|
|
144633
144630
|
const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
|
|
144634
|
-
let modifierFlags = effectiveModifierFlags &
|
|
144631
|
+
let modifierFlags = effectiveModifierFlags & 32 /* Static */;
|
|
144632
|
+
modifierFlags |= effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
|
|
144635
144633
|
if (declaration && isAutoAccessorPropertyDeclaration(declaration)) {
|
|
144636
144634
|
modifierFlags |= 128 /* Accessor */;
|
|
144637
144635
|
}
|
|
@@ -147158,6 +147156,7 @@ ${lanes.join("\n")}
|
|
|
147158
147156
|
}
|
|
147159
147157
|
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) {
|
|
147160
147158
|
let insertText;
|
|
147159
|
+
let filterText;
|
|
147161
147160
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
147162
147161
|
let data;
|
|
147163
147162
|
let isSnippet;
|
|
@@ -147214,11 +147213,15 @@ ${lanes.join("\n")}
|
|
|
147214
147213
|
}
|
|
147215
147214
|
if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === CompletionKind.MemberLike && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
147216
147215
|
let importAdder;
|
|
147217
|
-
|
|
147218
|
-
|
|
147219
|
-
|
|
147220
|
-
|
|
147221
|
-
|
|
147216
|
+
const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
|
|
147217
|
+
if (memberCompletionEntry) {
|
|
147218
|
+
({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
|
|
147219
|
+
if (importAdder == null ? void 0 : importAdder.hasFixes()) {
|
|
147220
|
+
hasAction = true;
|
|
147221
|
+
source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
|
|
147222
|
+
}
|
|
147223
|
+
} else {
|
|
147224
|
+
return void 0;
|
|
147222
147225
|
}
|
|
147223
147226
|
}
|
|
147224
147227
|
if (origin && originIsObjectLiteralMethod(origin)) {
|
|
@@ -147262,6 +147265,7 @@ ${lanes.join("\n")}
|
|
|
147262
147265
|
hasAction: hasAction ? true : void 0,
|
|
147263
147266
|
isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0,
|
|
147264
147267
|
insertText,
|
|
147268
|
+
filterText,
|
|
147265
147269
|
replacementSpan,
|
|
147266
147270
|
sourceDisplay,
|
|
147267
147271
|
labelDetails,
|
|
@@ -147279,13 +147283,14 @@ ${lanes.join("\n")}
|
|
|
147279
147283
|
return !!(symbol.flags & memberFlags) && (isClassLike(location) || location.parent && location.parent.parent && isClassElement(location.parent) && location === location.parent.name && location.parent.getLastToken(sourceFile) === location.parent.name && isClassLike(location.parent.parent) || location.parent && isSyntaxList(location) && isClassLike(location.parent));
|
|
147280
147284
|
}
|
|
147281
147285
|
function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) {
|
|
147286
|
+
var _a2;
|
|
147282
147287
|
const classLikeDeclaration = findAncestor(location, isClassLike);
|
|
147283
147288
|
if (!classLikeDeclaration) {
|
|
147284
|
-
return
|
|
147289
|
+
return void 0;
|
|
147285
147290
|
}
|
|
147286
147291
|
let isSnippet;
|
|
147287
|
-
let replacementSpan;
|
|
147288
147292
|
let insertText = name;
|
|
147293
|
+
const filterText = name;
|
|
147289
147294
|
const checker = program.getTypeChecker();
|
|
147290
147295
|
const sourceFile = location.getSourceFile();
|
|
147291
147296
|
const printer = createSnippetPrinter({
|
|
@@ -147314,9 +147319,9 @@ ${lanes.join("\n")}
|
|
|
147314
147319
|
);
|
|
147315
147320
|
}
|
|
147316
147321
|
let modifiers = 0 /* None */;
|
|
147317
|
-
const { modifiers: presentModifiers,
|
|
147318
|
-
const isAbstract =
|
|
147319
|
-
|
|
147322
|
+
const { modifiers: presentModifiers, modifierList: presentModifiersList } = getPresentModifiers(contextToken, sourceFile, position);
|
|
147323
|
+
const isAbstract = presentModifiers & 256 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 256 /* Abstract */;
|
|
147324
|
+
let completionNodes = [];
|
|
147320
147325
|
ts_codefix_exports.addNewNodeForMemberSymbol(
|
|
147321
147326
|
symbol,
|
|
147322
147327
|
classLikeDeclaration,
|
|
@@ -147340,18 +147345,38 @@ ${lanes.join("\n")}
|
|
|
147340
147345
|
requiredModifiers |= 16384 /* Override */;
|
|
147341
147346
|
}
|
|
147342
147347
|
if (!completionNodes.length) {
|
|
147343
|
-
modifiers = node.modifierFlagsCache | requiredModifiers
|
|
147348
|
+
modifiers = node.modifierFlagsCache | requiredModifiers;
|
|
147344
147349
|
}
|
|
147345
147350
|
node = factory.updateModifiers(node, modifiers);
|
|
147346
147351
|
completionNodes.push(node);
|
|
147347
147352
|
},
|
|
147348
147353
|
body,
|
|
147349
147354
|
ts_codefix_exports.PreserveOptionalFlags.Property,
|
|
147350
|
-
isAbstract
|
|
147355
|
+
!!isAbstract
|
|
147351
147356
|
);
|
|
147352
147357
|
if (completionNodes.length) {
|
|
147358
|
+
const isMethod = symbol.flags & 8192 /* Method */;
|
|
147359
|
+
let allowedModifiers = modifiers | 16384 /* Override */ | 4 /* Public */;
|
|
147360
|
+
if (!isMethod) {
|
|
147361
|
+
allowedModifiers |= 2 /* Ambient */ | 64 /* Readonly */;
|
|
147362
|
+
}
|
|
147363
|
+
const allowedAndPresent = presentModifiers & allowedModifiers;
|
|
147364
|
+
if (modifiers & 16 /* Protected */ && allowedAndPresent & 4 /* Public */) {
|
|
147365
|
+
modifiers &= ~16 /* Protected */;
|
|
147366
|
+
}
|
|
147367
|
+
if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 4 /* Public */)) {
|
|
147368
|
+
modifiers &= ~4 /* Public */;
|
|
147369
|
+
}
|
|
147370
|
+
modifiers |= allowedAndPresent;
|
|
147371
|
+
completionNodes = completionNodes.map((node) => factory.updateModifiers(node, modifiers));
|
|
147372
|
+
const modifiersInsertList = factory.createModifiersFromModifierFlags(modifiers);
|
|
147373
|
+
for (let i = 0; i < presentModifiersList.length; i++) {
|
|
147374
|
+
if (presentModifiersList[i].kind !== ((_a2 = modifiersInsertList == null ? void 0 : modifiersInsertList[i]) == null ? void 0 : _a2.kind)) {
|
|
147375
|
+
return void 0;
|
|
147376
|
+
}
|
|
147377
|
+
}
|
|
147378
|
+
completionNodes[0] = factory.updateModifiers(completionNodes[0], modifiers & ~presentModifiers);
|
|
147353
147379
|
const format = 1 /* MultiLine */ | 131072 /* NoTrailingNewLine */;
|
|
147354
|
-
replacementSpan = modifiersSpan;
|
|
147355
147380
|
if (formatContext) {
|
|
147356
147381
|
insertText = printer.printAndFormatSnippetList(
|
|
147357
147382
|
format,
|
|
@@ -147367,24 +147392,28 @@ ${lanes.join("\n")}
|
|
|
147367
147392
|
);
|
|
147368
147393
|
}
|
|
147369
147394
|
}
|
|
147370
|
-
return { insertText, isSnippet, importAdder
|
|
147395
|
+
return { insertText, filterText, isSnippet, importAdder };
|
|
147371
147396
|
}
|
|
147372
147397
|
function getPresentModifiers(contextToken, sourceFile, position) {
|
|
147398
|
+
var _a2;
|
|
147373
147399
|
if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) {
|
|
147374
|
-
return { modifiers: 0 /* None
|
|
147400
|
+
return { modifiers: 0 /* None */, modifierList: [] };
|
|
147375
147401
|
}
|
|
147376
147402
|
let modifiers = 0 /* None */;
|
|
147377
|
-
let
|
|
147403
|
+
let modifierList = [];
|
|
147378
147404
|
let contextMod;
|
|
147379
|
-
if (contextMod = isModifierLike2(contextToken)) {
|
|
147380
|
-
modifiers |= modifierToFlag(contextMod);
|
|
147381
|
-
span = createTextSpanFromNode(contextToken);
|
|
147382
|
-
}
|
|
147383
147405
|
if (isPropertyDeclaration(contextToken.parent)) {
|
|
147384
147406
|
modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 126975 /* Modifier */;
|
|
147385
|
-
|
|
147407
|
+
modifierList = ((_a2 = contextToken.parent.modifiers) == null ? void 0 : _a2.filter(isModifier)) || [];
|
|
147408
|
+
}
|
|
147409
|
+
if (contextMod = isModifierLike2(contextToken)) {
|
|
147410
|
+
const contextModifierFlag = modifierToFlag(contextMod);
|
|
147411
|
+
if (!(modifiers & contextModifierFlag)) {
|
|
147412
|
+
modifierList.push(factory.createToken(contextMod));
|
|
147413
|
+
modifiers |= contextModifierFlag;
|
|
147414
|
+
}
|
|
147386
147415
|
}
|
|
147387
|
-
return { modifiers,
|
|
147416
|
+
return { modifiers, modifierList };
|
|
147388
147417
|
}
|
|
147389
147418
|
function isModifierLike2(node) {
|
|
147390
147419
|
if (isModifier(node)) {
|
|
@@ -175733,6 +175762,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
175733
175762
|
kindModifiers,
|
|
175734
175763
|
sortText,
|
|
175735
175764
|
insertText,
|
|
175765
|
+
filterText,
|
|
175736
175766
|
replacementSpan,
|
|
175737
175767
|
hasAction,
|
|
175738
175768
|
source,
|
|
@@ -175751,6 +175781,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
175751
175781
|
kindModifiers,
|
|
175752
175782
|
sortText,
|
|
175753
175783
|
insertText,
|
|
175784
|
+
filterText,
|
|
175754
175785
|
replacementSpan: convertedSpan,
|
|
175755
175786
|
isSnippet,
|
|
175756
175787
|
hasAction: hasAction || void 0,
|
package/lib/typescript.d.ts
CHANGED
|
@@ -6696,6 +6696,7 @@ declare namespace ts {
|
|
|
6696
6696
|
kindModifiers?: string;
|
|
6697
6697
|
sortText: string;
|
|
6698
6698
|
insertText?: string;
|
|
6699
|
+
filterText?: string;
|
|
6699
6700
|
isSnippet?: true;
|
|
6700
6701
|
/**
|
|
6701
6702
|
* An optional span that indicates the text to be replaced by this completion item.
|
package/lib/typescript.js
CHANGED
|
@@ -18,17 +18,10 @@ and limitations under the License.
|
|
|
18
18
|
var ts = (() => {
|
|
19
19
|
var __defProp = Object.defineProperty;
|
|
20
20
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
21
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
22
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
23
|
-
}) : x)(function(x) {
|
|
24
|
-
if (typeof require !== "undefined")
|
|
25
|
-
return require.apply(this, arguments);
|
|
26
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
27
|
-
});
|
|
28
21
|
var __esm = (fn, res) => function __init() {
|
|
29
22
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
30
23
|
};
|
|
31
|
-
var __commonJS = (cb, mod) => function
|
|
24
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
32
25
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
33
26
|
};
|
|
34
27
|
var __export = (target, all) => {
|
|
@@ -42,7 +35,7 @@ var ts = (() => {
|
|
|
42
35
|
"src/compiler/corePublic.ts"() {
|
|
43
36
|
"use strict";
|
|
44
37
|
versionMajorMinor = "5.0";
|
|
45
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230130`;
|
|
46
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
47
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
48
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -8274,7 +8267,7 @@ ${lanes.join("\n")}
|
|
|
8274
8267
|
Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."),
|
|
8275
8268
|
Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."),
|
|
8276
8269
|
File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."),
|
|
8277
|
-
|
|
8270
|
+
File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."),
|
|
8278
8271
|
Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."),
|
|
8279
8272
|
Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."),
|
|
8280
8273
|
package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."),
|
|
@@ -30993,7 +30986,7 @@ ${lanes.join("\n")}
|
|
|
30993
30986
|
return Tristate.False;
|
|
30994
30987
|
}
|
|
30995
30988
|
if (languageVariant === 1 /* JSX */) {
|
|
30996
|
-
|
|
30989
|
+
const isArrowFunctionInJsx = lookAhead(() => {
|
|
30997
30990
|
parseOptional(85 /* ConstKeyword */);
|
|
30998
30991
|
const third = nextToken();
|
|
30999
30992
|
if (third === 94 /* ExtendsKeyword */) {
|
|
@@ -31001,15 +30994,19 @@ ${lanes.join("\n")}
|
|
|
31001
30994
|
switch (fourth) {
|
|
31002
30995
|
case 63 /* EqualsToken */:
|
|
31003
30996
|
case 31 /* GreaterThanToken */:
|
|
31004
|
-
return
|
|
30997
|
+
return false;
|
|
31005
30998
|
default:
|
|
31006
|
-
return
|
|
30999
|
+
return true;
|
|
31007
31000
|
}
|
|
31008
31001
|
} else if (third === 27 /* CommaToken */ || third === 63 /* EqualsToken */) {
|
|
31009
|
-
return
|
|
31002
|
+
return true;
|
|
31010
31003
|
}
|
|
31011
|
-
return
|
|
31004
|
+
return false;
|
|
31012
31005
|
});
|
|
31006
|
+
if (isArrowFunctionInJsx) {
|
|
31007
|
+
return Tristate.True;
|
|
31008
|
+
}
|
|
31009
|
+
return Tristate.False;
|
|
31013
31010
|
}
|
|
31014
31011
|
return Tristate.Unknown;
|
|
31015
31012
|
}
|
|
@@ -39572,7 +39569,7 @@ ${lanes.join("\n")}
|
|
|
39572
39569
|
if (!onlyRecordFailures) {
|
|
39573
39570
|
if (state.host.fileExists(fileName)) {
|
|
39574
39571
|
if (state.traceEnabled) {
|
|
39575
|
-
trace(state.host, Diagnostics.
|
|
39572
|
+
trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName);
|
|
39576
39573
|
}
|
|
39577
39574
|
return fileName;
|
|
39578
39575
|
} else {
|
|
@@ -66834,7 +66831,7 @@ ${lanes.join("\n")}
|
|
|
66834
66831
|
return narrowTypeByLiteralExpression(type, literal, assumeTrue);
|
|
66835
66832
|
}
|
|
66836
66833
|
function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
|
|
66837
|
-
return assumeTrue ? narrowTypeByTypeName(type, literal.text) :
|
|
66834
|
+
return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
|
|
66838
66835
|
}
|
|
66839
66836
|
function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
|
|
66840
66837
|
const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
|
|
@@ -80667,7 +80664,7 @@ ${lanes.join("\n")}
|
|
|
80667
80664
|
const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */);
|
|
80668
80665
|
if (node.expression.kind === 79 /* Identifier */) {
|
|
80669
80666
|
const id = node.expression;
|
|
80670
|
-
const sym = resolveEntityName(
|
|
80667
|
+
const sym = getExportSymbolOfValueSymbolIfExported(resolveEntityName(
|
|
80671
80668
|
id,
|
|
80672
80669
|
67108863 /* All */,
|
|
80673
80670
|
/*ignoreErrors*/
|
|
@@ -80675,7 +80672,7 @@ ${lanes.join("\n")}
|
|
|
80675
80672
|
/*dontResolveAlias*/
|
|
80676
80673
|
true,
|
|
80677
80674
|
node
|
|
80678
|
-
);
|
|
80675
|
+
));
|
|
80679
80676
|
if (sym) {
|
|
80680
80677
|
markAliasReferenced(sym, id);
|
|
80681
80678
|
if (getAllSymbolFlags(sym) & 111551 /* Value */) {
|
|
@@ -85832,7 +85829,7 @@ ${lanes.join("\n")}
|
|
|
85832
85829
|
[291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
85833
85830
|
return context.factory.updateJsxExpression(
|
|
85834
85831
|
node,
|
|
85835
|
-
|
|
85832
|
+
nodeVisitor(node.expression, visitor, isExpression)
|
|
85836
85833
|
);
|
|
85837
85834
|
},
|
|
85838
85835
|
// Clauses
|
|
@@ -144645,7 +144642,8 @@ ${lanes.join("\n")}
|
|
|
144645
144642
|
false
|
|
144646
144643
|
);
|
|
144647
144644
|
const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
|
|
144648
|
-
let modifierFlags = effectiveModifierFlags &
|
|
144645
|
+
let modifierFlags = effectiveModifierFlags & 32 /* Static */;
|
|
144646
|
+
modifierFlags |= effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
|
|
144649
144647
|
if (declaration && isAutoAccessorPropertyDeclaration(declaration)) {
|
|
144650
144648
|
modifierFlags |= 128 /* Accessor */;
|
|
144651
144649
|
}
|
|
@@ -147172,6 +147170,7 @@ ${lanes.join("\n")}
|
|
|
147172
147170
|
}
|
|
147173
147171
|
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) {
|
|
147174
147172
|
let insertText;
|
|
147173
|
+
let filterText;
|
|
147175
147174
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
147176
147175
|
let data;
|
|
147177
147176
|
let isSnippet;
|
|
@@ -147228,11 +147227,15 @@ ${lanes.join("\n")}
|
|
|
147228
147227
|
}
|
|
147229
147228
|
if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === CompletionKind.MemberLike && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
147230
147229
|
let importAdder;
|
|
147231
|
-
|
|
147232
|
-
|
|
147233
|
-
|
|
147234
|
-
|
|
147235
|
-
|
|
147230
|
+
const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
|
|
147231
|
+
if (memberCompletionEntry) {
|
|
147232
|
+
({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
|
|
147233
|
+
if (importAdder == null ? void 0 : importAdder.hasFixes()) {
|
|
147234
|
+
hasAction = true;
|
|
147235
|
+
source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
|
|
147236
|
+
}
|
|
147237
|
+
} else {
|
|
147238
|
+
return void 0;
|
|
147236
147239
|
}
|
|
147237
147240
|
}
|
|
147238
147241
|
if (origin && originIsObjectLiteralMethod(origin)) {
|
|
@@ -147276,6 +147279,7 @@ ${lanes.join("\n")}
|
|
|
147276
147279
|
hasAction: hasAction ? true : void 0,
|
|
147277
147280
|
isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0,
|
|
147278
147281
|
insertText,
|
|
147282
|
+
filterText,
|
|
147279
147283
|
replacementSpan,
|
|
147280
147284
|
sourceDisplay,
|
|
147281
147285
|
labelDetails,
|
|
@@ -147293,13 +147297,14 @@ ${lanes.join("\n")}
|
|
|
147293
147297
|
return !!(symbol.flags & memberFlags) && (isClassLike(location) || location.parent && location.parent.parent && isClassElement(location.parent) && location === location.parent.name && location.parent.getLastToken(sourceFile) === location.parent.name && isClassLike(location.parent.parent) || location.parent && isSyntaxList(location) && isClassLike(location.parent));
|
|
147294
147298
|
}
|
|
147295
147299
|
function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) {
|
|
147300
|
+
var _a2;
|
|
147296
147301
|
const classLikeDeclaration = findAncestor(location, isClassLike);
|
|
147297
147302
|
if (!classLikeDeclaration) {
|
|
147298
|
-
return
|
|
147303
|
+
return void 0;
|
|
147299
147304
|
}
|
|
147300
147305
|
let isSnippet;
|
|
147301
|
-
let replacementSpan;
|
|
147302
147306
|
let insertText = name;
|
|
147307
|
+
const filterText = name;
|
|
147303
147308
|
const checker = program.getTypeChecker();
|
|
147304
147309
|
const sourceFile = location.getSourceFile();
|
|
147305
147310
|
const printer = createSnippetPrinter({
|
|
@@ -147328,9 +147333,9 @@ ${lanes.join("\n")}
|
|
|
147328
147333
|
);
|
|
147329
147334
|
}
|
|
147330
147335
|
let modifiers = 0 /* None */;
|
|
147331
|
-
const { modifiers: presentModifiers,
|
|
147332
|
-
const isAbstract =
|
|
147333
|
-
|
|
147336
|
+
const { modifiers: presentModifiers, modifierList: presentModifiersList } = getPresentModifiers(contextToken, sourceFile, position);
|
|
147337
|
+
const isAbstract = presentModifiers & 256 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 256 /* Abstract */;
|
|
147338
|
+
let completionNodes = [];
|
|
147334
147339
|
ts_codefix_exports.addNewNodeForMemberSymbol(
|
|
147335
147340
|
symbol,
|
|
147336
147341
|
classLikeDeclaration,
|
|
@@ -147354,18 +147359,38 @@ ${lanes.join("\n")}
|
|
|
147354
147359
|
requiredModifiers |= 16384 /* Override */;
|
|
147355
147360
|
}
|
|
147356
147361
|
if (!completionNodes.length) {
|
|
147357
|
-
modifiers = node.modifierFlagsCache | requiredModifiers
|
|
147362
|
+
modifiers = node.modifierFlagsCache | requiredModifiers;
|
|
147358
147363
|
}
|
|
147359
147364
|
node = factory.updateModifiers(node, modifiers);
|
|
147360
147365
|
completionNodes.push(node);
|
|
147361
147366
|
},
|
|
147362
147367
|
body,
|
|
147363
147368
|
ts_codefix_exports.PreserveOptionalFlags.Property,
|
|
147364
|
-
isAbstract
|
|
147369
|
+
!!isAbstract
|
|
147365
147370
|
);
|
|
147366
147371
|
if (completionNodes.length) {
|
|
147372
|
+
const isMethod = symbol.flags & 8192 /* Method */;
|
|
147373
|
+
let allowedModifiers = modifiers | 16384 /* Override */ | 4 /* Public */;
|
|
147374
|
+
if (!isMethod) {
|
|
147375
|
+
allowedModifiers |= 2 /* Ambient */ | 64 /* Readonly */;
|
|
147376
|
+
}
|
|
147377
|
+
const allowedAndPresent = presentModifiers & allowedModifiers;
|
|
147378
|
+
if (modifiers & 16 /* Protected */ && allowedAndPresent & 4 /* Public */) {
|
|
147379
|
+
modifiers &= ~16 /* Protected */;
|
|
147380
|
+
}
|
|
147381
|
+
if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 4 /* Public */)) {
|
|
147382
|
+
modifiers &= ~4 /* Public */;
|
|
147383
|
+
}
|
|
147384
|
+
modifiers |= allowedAndPresent;
|
|
147385
|
+
completionNodes = completionNodes.map((node) => factory.updateModifiers(node, modifiers));
|
|
147386
|
+
const modifiersInsertList = factory.createModifiersFromModifierFlags(modifiers);
|
|
147387
|
+
for (let i = 0; i < presentModifiersList.length; i++) {
|
|
147388
|
+
if (presentModifiersList[i].kind !== ((_a2 = modifiersInsertList == null ? void 0 : modifiersInsertList[i]) == null ? void 0 : _a2.kind)) {
|
|
147389
|
+
return void 0;
|
|
147390
|
+
}
|
|
147391
|
+
}
|
|
147392
|
+
completionNodes[0] = factory.updateModifiers(completionNodes[0], modifiers & ~presentModifiers);
|
|
147367
147393
|
const format = 1 /* MultiLine */ | 131072 /* NoTrailingNewLine */;
|
|
147368
|
-
replacementSpan = modifiersSpan;
|
|
147369
147394
|
if (formatContext) {
|
|
147370
147395
|
insertText = printer.printAndFormatSnippetList(
|
|
147371
147396
|
format,
|
|
@@ -147381,24 +147406,28 @@ ${lanes.join("\n")}
|
|
|
147381
147406
|
);
|
|
147382
147407
|
}
|
|
147383
147408
|
}
|
|
147384
|
-
return { insertText, isSnippet, importAdder
|
|
147409
|
+
return { insertText, filterText, isSnippet, importAdder };
|
|
147385
147410
|
}
|
|
147386
147411
|
function getPresentModifiers(contextToken, sourceFile, position) {
|
|
147412
|
+
var _a2;
|
|
147387
147413
|
if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) {
|
|
147388
|
-
return { modifiers: 0 /* None
|
|
147414
|
+
return { modifiers: 0 /* None */, modifierList: [] };
|
|
147389
147415
|
}
|
|
147390
147416
|
let modifiers = 0 /* None */;
|
|
147391
|
-
let
|
|
147417
|
+
let modifierList = [];
|
|
147392
147418
|
let contextMod;
|
|
147393
|
-
if (contextMod = isModifierLike2(contextToken)) {
|
|
147394
|
-
modifiers |= modifierToFlag(contextMod);
|
|
147395
|
-
span = createTextSpanFromNode(contextToken);
|
|
147396
|
-
}
|
|
147397
147419
|
if (isPropertyDeclaration(contextToken.parent)) {
|
|
147398
147420
|
modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 126975 /* Modifier */;
|
|
147399
|
-
|
|
147421
|
+
modifierList = ((_a2 = contextToken.parent.modifiers) == null ? void 0 : _a2.filter(isModifier)) || [];
|
|
147422
|
+
}
|
|
147423
|
+
if (contextMod = isModifierLike2(contextToken)) {
|
|
147424
|
+
const contextModifierFlag = modifierToFlag(contextMod);
|
|
147425
|
+
if (!(modifiers & contextModifierFlag)) {
|
|
147426
|
+
modifierList.push(factory.createToken(contextMod));
|
|
147427
|
+
modifiers |= contextModifierFlag;
|
|
147428
|
+
}
|
|
147400
147429
|
}
|
|
147401
|
-
return { modifiers,
|
|
147430
|
+
return { modifiers, modifierList };
|
|
147402
147431
|
}
|
|
147403
147432
|
function isModifierLike2(node) {
|
|
147404
147433
|
if (isModifier(node)) {
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.0";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20230130`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -6388,7 +6388,7 @@ var Diagnostics = {
|
|
|
6388
6388
|
Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."),
|
|
6389
6389
|
Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."),
|
|
6390
6390
|
File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."),
|
|
6391
|
-
|
|
6391
|
+
File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."),
|
|
6392
6392
|
Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."),
|
|
6393
6393
|
Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."),
|
|
6394
6394
|
package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."),
|
|
@@ -21799,7 +21799,7 @@ var Parser;
|
|
|
21799
21799
|
return Tristate.False;
|
|
21800
21800
|
}
|
|
21801
21801
|
if (languageVariant === 1 /* JSX */) {
|
|
21802
|
-
|
|
21802
|
+
const isArrowFunctionInJsx = lookAhead(() => {
|
|
21803
21803
|
parseOptional(85 /* ConstKeyword */);
|
|
21804
21804
|
const third = nextToken();
|
|
21805
21805
|
if (third === 94 /* ExtendsKeyword */) {
|
|
@@ -21807,15 +21807,19 @@ var Parser;
|
|
|
21807
21807
|
switch (fourth) {
|
|
21808
21808
|
case 63 /* EqualsToken */:
|
|
21809
21809
|
case 31 /* GreaterThanToken */:
|
|
21810
|
-
return
|
|
21810
|
+
return false;
|
|
21811
21811
|
default:
|
|
21812
|
-
return
|
|
21812
|
+
return true;
|
|
21813
21813
|
}
|
|
21814
21814
|
} else if (third === 27 /* CommaToken */ || third === 63 /* EqualsToken */) {
|
|
21815
|
-
return
|
|
21815
|
+
return true;
|
|
21816
21816
|
}
|
|
21817
|
-
return
|
|
21817
|
+
return false;
|
|
21818
21818
|
});
|
|
21819
|
+
if (isArrowFunctionInJsx) {
|
|
21820
|
+
return Tristate.True;
|
|
21821
|
+
}
|
|
21822
|
+
return Tristate.False;
|
|
21819
21823
|
}
|
|
21820
21824
|
return Tristate.Unknown;
|
|
21821
21825
|
}
|
|
@@ -28659,7 +28663,7 @@ function tryFileLookup(fileName, onlyRecordFailures, state) {
|
|
|
28659
28663
|
if (!onlyRecordFailures) {
|
|
28660
28664
|
if (state.host.fileExists(fileName)) {
|
|
28661
28665
|
if (state.traceEnabled) {
|
|
28662
|
-
trace(state.host, Diagnostics.
|
|
28666
|
+
trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName);
|
|
28663
28667
|
}
|
|
28664
28668
|
return fileName;
|
|
28665
28669
|
} else {
|
|
@@ -33752,7 +33756,7 @@ var visitEachChildTable = {
|
|
|
33752
33756
|
[291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
33753
33757
|
return context.factory.updateJsxExpression(
|
|
33754
33758
|
node,
|
|
33755
|
-
|
|
33759
|
+
nodeVisitor(node.expression, visitor, isExpression)
|
|
33756
33760
|
);
|
|
33757
33761
|
},
|
|
33758
33762
|
// Clauses
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.0.0-pr-
|
|
5
|
+
"version": "5.0.0-pr-52525-3",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|