@typescript-deploys/pr-build 5.1.0-pr-52226-2 → 5.1.0-pr-52845-10
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 +271 -231
- package/lib/tsserver.js +341 -293
- package/lib/tsserverlibrary.d.ts +48 -0
- package/lib/tsserverlibrary.js +342 -293
- package/lib/typescript.d.ts +48 -0
- package/lib/typescript.js +342 -292
- package/lib/typingsInstaller.js +127 -3797
- package/package.json +3 -2
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230308`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3545,7 +3545,7 @@ ${lanes.join("\n")}
|
|
|
3545
3545
|
const name = DiagnosticCategory[d.category];
|
|
3546
3546
|
return lowerCase ? name.toLowerCase() : name;
|
|
3547
3547
|
}
|
|
3548
|
-
var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas
|
|
3548
|
+
var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas;
|
|
3549
3549
|
var init_types = __esm({
|
|
3550
3550
|
"src/compiler/types.ts"() {
|
|
3551
3551
|
"use strict";
|
|
@@ -4646,6 +4646,7 @@ ${lanes.join("\n")}
|
|
|
4646
4646
|
})(DiagnosticCategory || {});
|
|
4647
4647
|
ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind3) => {
|
|
4648
4648
|
ModuleResolutionKind3[ModuleResolutionKind3["Classic"] = 1] = "Classic";
|
|
4649
|
+
ModuleResolutionKind3[ModuleResolutionKind3["NodeJs"] = 2] = "NodeJs";
|
|
4649
4650
|
ModuleResolutionKind3[ModuleResolutionKind3["Node10"] = 2] = "Node10";
|
|
4650
4651
|
ModuleResolutionKind3[ModuleResolutionKind3["Node16"] = 3] = "Node16";
|
|
4651
4652
|
ModuleResolutionKind3[ModuleResolutionKind3["NodeNext"] = 99] = "NodeNext";
|
|
@@ -5210,12 +5211,6 @@ ${lanes.join("\n")}
|
|
|
5210
5211
|
kind: 4 /* MultiLine */
|
|
5211
5212
|
}
|
|
5212
5213
|
};
|
|
5213
|
-
DeprecationVersion = /* @__PURE__ */ ((DeprecationVersion2) => {
|
|
5214
|
-
DeprecationVersion2["v5_0"] = "5.0";
|
|
5215
|
-
DeprecationVersion2["v5_5"] = "5.5";
|
|
5216
|
-
DeprecationVersion2["v6_0"] = "6.0";
|
|
5217
|
-
return DeprecationVersion2;
|
|
5218
|
-
})(DeprecationVersion || {});
|
|
5219
5214
|
}
|
|
5220
5215
|
});
|
|
5221
5216
|
|
|
@@ -8140,12 +8135,14 @@ ${lanes.join("\n")}
|
|
|
8140
8135
|
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."),
|
|
8141
8136
|
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."),
|
|
8142
8137
|
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'."),
|
|
8143
|
-
|
|
8144
|
-
|
|
8138
|
+
Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101", `Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`),
|
|
8139
|
+
Option_0_has_been_removed_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102", "Option '{0}' has been removed. Please remove it from your configuration."),
|
|
8145
8140
|
Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."),
|
|
8146
8141
|
Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."),
|
|
8147
8142
|
Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: diag(5105, 1 /* Error */, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."),
|
|
8148
8143
|
Use_0_instead: diag(5106, 3 /* Message */, "Use_0_instead_5106", "Use '{0}' instead."),
|
|
8144
|
+
Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error: diag(5107, 1 /* Error */, "Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107", `Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '"ignoreDeprecations": "{3}"' to silence this error.`),
|
|
8145
|
+
Option_0_1_has_been_removed_Please_remove_it_from_your_configuration: diag(5108, 1 /* Error */, "Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108", "Option '{0}={1}' has been removed. Please remove it from your configuration."),
|
|
8149
8146
|
Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."),
|
|
8150
8147
|
Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."),
|
|
8151
8148
|
Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."),
|
|
@@ -9582,8 +9579,8 @@ ${lanes.join("\n")}
|
|
|
9582
9579
|
var text = textInitial;
|
|
9583
9580
|
var pos;
|
|
9584
9581
|
var end;
|
|
9585
|
-
var
|
|
9586
|
-
var
|
|
9582
|
+
var fullStartPos;
|
|
9583
|
+
var tokenStart;
|
|
9587
9584
|
var token;
|
|
9588
9585
|
var tokenValue;
|
|
9589
9586
|
var tokenFlags;
|
|
@@ -9591,11 +9588,14 @@ ${lanes.join("\n")}
|
|
|
9591
9588
|
var inJSDocType = 0;
|
|
9592
9589
|
setText(text, start, length2);
|
|
9593
9590
|
var scanner2 = {
|
|
9594
|
-
|
|
9591
|
+
getTokenFullStart: () => fullStartPos,
|
|
9592
|
+
getStartPos: () => fullStartPos,
|
|
9593
|
+
getTokenEnd: () => pos,
|
|
9595
9594
|
getTextPos: () => pos,
|
|
9596
9595
|
getToken: () => token,
|
|
9597
|
-
|
|
9598
|
-
|
|
9596
|
+
getTokenStart: () => tokenStart,
|
|
9597
|
+
getTokenPos: () => tokenStart,
|
|
9598
|
+
getTokenText: () => text.substring(tokenStart, pos),
|
|
9599
9599
|
getTokenValue: () => tokenValue,
|
|
9600
9600
|
hasUnicodeEscape: () => (tokenFlags & 1024 /* UnicodeEscape */) !== 0,
|
|
9601
9601
|
hasExtendedUnicodeEscape: () => (tokenFlags & 8 /* ExtendedUnicodeEscape */) !== 0,
|
|
@@ -9629,7 +9629,8 @@ ${lanes.join("\n")}
|
|
|
9629
9629
|
setScriptTarget,
|
|
9630
9630
|
setLanguageVariant,
|
|
9631
9631
|
setOnError,
|
|
9632
|
-
|
|
9632
|
+
resetTokenState,
|
|
9633
|
+
setTextPos: resetTokenState,
|
|
9633
9634
|
setInJSDocType,
|
|
9634
9635
|
tryScan,
|
|
9635
9636
|
lookAhead,
|
|
@@ -9639,7 +9640,7 @@ ${lanes.join("\n")}
|
|
|
9639
9640
|
Object.defineProperty(scanner2, "__debugShowCurrentPositionInText", {
|
|
9640
9641
|
get: () => {
|
|
9641
9642
|
const text2 = scanner2.getText();
|
|
9642
|
-
return text2.slice(0, scanner2.
|
|
9643
|
+
return text2.slice(0, scanner2.getTokenFullStart()) + "\u2551" + text2.slice(scanner2.getTokenFullStart());
|
|
9643
9644
|
}
|
|
9644
9645
|
});
|
|
9645
9646
|
}
|
|
@@ -10162,11 +10163,11 @@ ${lanes.join("\n")}
|
|
|
10162
10163
|
}
|
|
10163
10164
|
}
|
|
10164
10165
|
function scan() {
|
|
10165
|
-
|
|
10166
|
+
fullStartPos = pos;
|
|
10166
10167
|
tokenFlags = 0 /* None */;
|
|
10167
10168
|
let asteriskSeen = false;
|
|
10168
10169
|
while (true) {
|
|
10169
|
-
|
|
10170
|
+
tokenStart = pos;
|
|
10170
10171
|
if (pos >= end) {
|
|
10171
10172
|
return token = 1 /* EndOfFileToken */;
|
|
10172
10173
|
}
|
|
@@ -10325,9 +10326,9 @@ ${lanes.join("\n")}
|
|
|
10325
10326
|
}
|
|
10326
10327
|
commentDirectives = appendIfCommentDirective(
|
|
10327
10328
|
commentDirectives,
|
|
10328
|
-
text.slice(
|
|
10329
|
+
text.slice(tokenStart, pos),
|
|
10329
10330
|
commentDirectiveRegExSingleLine,
|
|
10330
|
-
|
|
10331
|
+
tokenStart
|
|
10331
10332
|
);
|
|
10332
10333
|
if (skipTrivia2) {
|
|
10333
10334
|
continue;
|
|
@@ -10341,7 +10342,7 @@ ${lanes.join("\n")}
|
|
|
10341
10342
|
tokenFlags |= 2 /* PrecedingJSDocComment */;
|
|
10342
10343
|
}
|
|
10343
10344
|
let commentClosed = false;
|
|
10344
|
-
let lastLineStart =
|
|
10345
|
+
let lastLineStart = tokenStart;
|
|
10345
10346
|
while (pos < end) {
|
|
10346
10347
|
const ch2 = text.charCodeAt(pos);
|
|
10347
10348
|
if (ch2 === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) {
|
|
@@ -10619,7 +10620,7 @@ ${lanes.join("\n")}
|
|
|
10619
10620
|
}
|
|
10620
10621
|
function reScanInvalidIdentifier() {
|
|
10621
10622
|
Debug.assert(token === 0 /* Unknown */, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'.");
|
|
10622
|
-
pos =
|
|
10623
|
+
pos = tokenStart = fullStartPos;
|
|
10623
10624
|
tokenFlags = 0;
|
|
10624
10625
|
const ch = codePointAt(text, pos);
|
|
10625
10626
|
const identifierKind = scanIdentifier(ch, 99 /* ESNext */);
|
|
@@ -10635,7 +10636,7 @@ ${lanes.join("\n")}
|
|
|
10635
10636
|
pos += charSize(ch);
|
|
10636
10637
|
while (pos < end && isIdentifierPart(ch = codePointAt(text, pos), languageVersion2))
|
|
10637
10638
|
pos += charSize(ch);
|
|
10638
|
-
tokenValue = text.substring(
|
|
10639
|
+
tokenValue = text.substring(tokenStart, pos);
|
|
10639
10640
|
if (ch === 92 /* backslash */) {
|
|
10640
10641
|
tokenValue += scanIdentifierParts();
|
|
10641
10642
|
}
|
|
@@ -10666,12 +10667,12 @@ ${lanes.join("\n")}
|
|
|
10666
10667
|
}
|
|
10667
10668
|
function reScanAsteriskEqualsToken() {
|
|
10668
10669
|
Debug.assert(token === 66 /* AsteriskEqualsToken */, "'reScanAsteriskEqualsToken' should only be called on a '*='");
|
|
10669
|
-
pos =
|
|
10670
|
+
pos = tokenStart + 1;
|
|
10670
10671
|
return token = 63 /* EqualsToken */;
|
|
10671
10672
|
}
|
|
10672
10673
|
function reScanSlashToken() {
|
|
10673
10674
|
if (token === 43 /* SlashToken */ || token === 68 /* SlashEqualsToken */) {
|
|
10674
|
-
let p =
|
|
10675
|
+
let p = tokenStart + 1;
|
|
10675
10676
|
let inEscape = false;
|
|
10676
10677
|
let inCharacterClass = false;
|
|
10677
10678
|
while (true) {
|
|
@@ -10704,7 +10705,7 @@ ${lanes.join("\n")}
|
|
|
10704
10705
|
p++;
|
|
10705
10706
|
}
|
|
10706
10707
|
pos = p;
|
|
10707
|
-
tokenValue = text.substring(
|
|
10708
|
+
tokenValue = text.substring(tokenStart, pos);
|
|
10708
10709
|
token = 13 /* RegularExpressionLiteral */;
|
|
10709
10710
|
}
|
|
10710
10711
|
return token;
|
|
@@ -10737,41 +10738,41 @@ ${lanes.join("\n")}
|
|
|
10737
10738
|
}
|
|
10738
10739
|
function reScanTemplateToken(isTaggedTemplate) {
|
|
10739
10740
|
Debug.assert(token === 19 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'");
|
|
10740
|
-
pos =
|
|
10741
|
+
pos = tokenStart;
|
|
10741
10742
|
return token = scanTemplateAndSetTokenValue(isTaggedTemplate);
|
|
10742
10743
|
}
|
|
10743
10744
|
function reScanTemplateHeadOrNoSubstitutionTemplate() {
|
|
10744
|
-
pos =
|
|
10745
|
+
pos = tokenStart;
|
|
10745
10746
|
return token = scanTemplateAndSetTokenValue(
|
|
10746
10747
|
/* isTaggedTemplate */
|
|
10747
10748
|
true
|
|
10748
10749
|
);
|
|
10749
10750
|
}
|
|
10750
10751
|
function reScanJsxToken(allowMultilineJsxText = true) {
|
|
10751
|
-
pos =
|
|
10752
|
+
pos = tokenStart = fullStartPos;
|
|
10752
10753
|
return token = scanJsxToken(allowMultilineJsxText);
|
|
10753
10754
|
}
|
|
10754
10755
|
function reScanLessThanToken() {
|
|
10755
10756
|
if (token === 47 /* LessThanLessThanToken */) {
|
|
10756
|
-
pos =
|
|
10757
|
+
pos = tokenStart + 1;
|
|
10757
10758
|
return token = 29 /* LessThanToken */;
|
|
10758
10759
|
}
|
|
10759
10760
|
return token;
|
|
10760
10761
|
}
|
|
10761
10762
|
function reScanHashToken() {
|
|
10762
10763
|
if (token === 80 /* PrivateIdentifier */) {
|
|
10763
|
-
pos =
|
|
10764
|
+
pos = tokenStart + 1;
|
|
10764
10765
|
return token = 62 /* HashToken */;
|
|
10765
10766
|
}
|
|
10766
10767
|
return token;
|
|
10767
10768
|
}
|
|
10768
10769
|
function reScanQuestionToken() {
|
|
10769
10770
|
Debug.assert(token === 60 /* QuestionQuestionToken */, "'reScanQuestionToken' should only be called on a '??'");
|
|
10770
|
-
pos =
|
|
10771
|
+
pos = tokenStart + 1;
|
|
10771
10772
|
return token = 57 /* QuestionToken */;
|
|
10772
10773
|
}
|
|
10773
10774
|
function scanJsxToken(allowMultilineJsxText = true) {
|
|
10774
|
-
|
|
10775
|
+
fullStartPos = tokenStart = pos;
|
|
10775
10776
|
if (pos >= end) {
|
|
10776
10777
|
return token = 1 /* EndOfFileToken */;
|
|
10777
10778
|
}
|
|
@@ -10816,7 +10817,7 @@ ${lanes.join("\n")}
|
|
|
10816
10817
|
}
|
|
10817
10818
|
pos++;
|
|
10818
10819
|
}
|
|
10819
|
-
tokenValue = text.substring(
|
|
10820
|
+
tokenValue = text.substring(fullStartPos, pos);
|
|
10820
10821
|
return firstNonWhitespace === -1 ? 12 /* JsxTextAllWhiteSpaces */ : 11 /* JsxText */;
|
|
10821
10822
|
}
|
|
10822
10823
|
function scanJsxIdentifier() {
|
|
@@ -10850,7 +10851,7 @@ ${lanes.join("\n")}
|
|
|
10850
10851
|
return token;
|
|
10851
10852
|
}
|
|
10852
10853
|
function scanJsxAttributeValue() {
|
|
10853
|
-
|
|
10854
|
+
fullStartPos = pos;
|
|
10854
10855
|
switch (text.charCodeAt(pos)) {
|
|
10855
10856
|
case 34 /* doubleQuote */:
|
|
10856
10857
|
case 39 /* singleQuote */:
|
|
@@ -10864,11 +10865,11 @@ ${lanes.join("\n")}
|
|
|
10864
10865
|
}
|
|
10865
10866
|
}
|
|
10866
10867
|
function reScanJsxAttributeValue() {
|
|
10867
|
-
pos =
|
|
10868
|
+
pos = tokenStart = fullStartPos;
|
|
10868
10869
|
return scanJsxAttributeValue();
|
|
10869
10870
|
}
|
|
10870
10871
|
function scanJsDocToken() {
|
|
10871
|
-
|
|
10872
|
+
fullStartPos = tokenStart = pos;
|
|
10872
10873
|
tokenFlags = 0 /* None */;
|
|
10873
10874
|
if (pos >= end) {
|
|
10874
10875
|
return token = 1 /* EndOfFileToken */;
|
|
@@ -10940,7 +10941,7 @@ ${lanes.join("\n")}
|
|
|
10940
10941
|
let char = ch;
|
|
10941
10942
|
while (pos < end && isIdentifierPart(char = codePointAt(text, pos), languageVersion) || text.charCodeAt(pos) === 45 /* minus */)
|
|
10942
10943
|
pos += charSize(char);
|
|
10943
|
-
tokenValue = text.substring(
|
|
10944
|
+
tokenValue = text.substring(tokenStart, pos);
|
|
10944
10945
|
if (char === 92 /* backslash */) {
|
|
10945
10946
|
tokenValue += scanIdentifierParts();
|
|
10946
10947
|
}
|
|
@@ -10951,16 +10952,16 @@ ${lanes.join("\n")}
|
|
|
10951
10952
|
}
|
|
10952
10953
|
function speculationHelper(callback, isLookahead) {
|
|
10953
10954
|
const savePos = pos;
|
|
10954
|
-
const saveStartPos =
|
|
10955
|
-
const saveTokenPos =
|
|
10955
|
+
const saveStartPos = fullStartPos;
|
|
10956
|
+
const saveTokenPos = tokenStart;
|
|
10956
10957
|
const saveToken = token;
|
|
10957
10958
|
const saveTokenValue = tokenValue;
|
|
10958
10959
|
const saveTokenFlags = tokenFlags;
|
|
10959
10960
|
const result = callback();
|
|
10960
10961
|
if (!result || isLookahead) {
|
|
10961
10962
|
pos = savePos;
|
|
10962
|
-
|
|
10963
|
-
|
|
10963
|
+
fullStartPos = saveStartPos;
|
|
10964
|
+
tokenStart = saveTokenPos;
|
|
10964
10965
|
token = saveToken;
|
|
10965
10966
|
tokenValue = saveTokenValue;
|
|
10966
10967
|
tokenFlags = saveTokenFlags;
|
|
@@ -10970,8 +10971,8 @@ ${lanes.join("\n")}
|
|
|
10970
10971
|
function scanRange(start2, length3, callback) {
|
|
10971
10972
|
const saveEnd = end;
|
|
10972
10973
|
const savePos = pos;
|
|
10973
|
-
const saveStartPos =
|
|
10974
|
-
const saveTokenPos =
|
|
10974
|
+
const saveStartPos = fullStartPos;
|
|
10975
|
+
const saveTokenPos = tokenStart;
|
|
10975
10976
|
const saveToken = token;
|
|
10976
10977
|
const saveTokenValue = tokenValue;
|
|
10977
10978
|
const saveTokenFlags = tokenFlags;
|
|
@@ -10980,8 +10981,8 @@ ${lanes.join("\n")}
|
|
|
10980
10981
|
const result = callback();
|
|
10981
10982
|
end = saveEnd;
|
|
10982
10983
|
pos = savePos;
|
|
10983
|
-
|
|
10984
|
-
|
|
10984
|
+
fullStartPos = saveStartPos;
|
|
10985
|
+
tokenStart = saveTokenPos;
|
|
10985
10986
|
token = saveToken;
|
|
10986
10987
|
tokenValue = saveTokenValue;
|
|
10987
10988
|
tokenFlags = saveTokenFlags;
|
|
@@ -11011,7 +11012,7 @@ ${lanes.join("\n")}
|
|
|
11011
11012
|
function setText(newText, start2, length3) {
|
|
11012
11013
|
text = newText || "";
|
|
11013
11014
|
end = length3 === void 0 ? text.length : start2 + length3;
|
|
11014
|
-
|
|
11015
|
+
resetTokenState(start2 || 0);
|
|
11015
11016
|
}
|
|
11016
11017
|
function setOnError(errorCallback) {
|
|
11017
11018
|
onError = errorCallback;
|
|
@@ -11022,11 +11023,11 @@ ${lanes.join("\n")}
|
|
|
11022
11023
|
function setLanguageVariant(variant) {
|
|
11023
11024
|
languageVariant = variant;
|
|
11024
11025
|
}
|
|
11025
|
-
function
|
|
11026
|
-
Debug.assert(
|
|
11027
|
-
pos =
|
|
11028
|
-
|
|
11029
|
-
|
|
11026
|
+
function resetTokenState(position) {
|
|
11027
|
+
Debug.assert(position >= 0);
|
|
11028
|
+
pos = position;
|
|
11029
|
+
fullStartPos = position;
|
|
11030
|
+
tokenStart = position;
|
|
11030
11031
|
token = 0 /* Unknown */;
|
|
11031
11032
|
tokenValue = void 0;
|
|
11032
11033
|
tokenFlags = 0 /* None */;
|
|
@@ -13939,8 +13940,8 @@ ${lanes.join("\n")}
|
|
|
13939
13940
|
pos
|
|
13940
13941
|
);
|
|
13941
13942
|
scanner2.scan();
|
|
13942
|
-
const start = scanner2.
|
|
13943
|
-
return createTextSpanFromBounds(start, scanner2.
|
|
13943
|
+
const start = scanner2.getTokenStart();
|
|
13944
|
+
return createTextSpanFromBounds(start, scanner2.getTokenEnd());
|
|
13944
13945
|
}
|
|
13945
13946
|
function scanTokenAtPosition(sourceFile, pos) {
|
|
13946
13947
|
const scanner2 = createScanner(
|
|
@@ -13970,7 +13971,7 @@ ${lanes.join("\n")}
|
|
|
13970
13971
|
function getErrorSpanForNode(sourceFile, node) {
|
|
13971
13972
|
let errorNode = node;
|
|
13972
13973
|
switch (node.kind) {
|
|
13973
|
-
case 308 /* SourceFile */:
|
|
13974
|
+
case 308 /* SourceFile */: {
|
|
13974
13975
|
const pos2 = skipTrivia(
|
|
13975
13976
|
sourceFile.text,
|
|
13976
13977
|
0,
|
|
@@ -13981,6 +13982,7 @@ ${lanes.join("\n")}
|
|
|
13981
13982
|
return createTextSpan(0, 0);
|
|
13982
13983
|
}
|
|
13983
13984
|
return getSpanOfTokenAtPosition(sourceFile, pos2);
|
|
13985
|
+
}
|
|
13984
13986
|
case 257 /* VariableDeclaration */:
|
|
13985
13987
|
case 205 /* BindingElement */:
|
|
13986
13988
|
case 260 /* ClassDeclaration */:
|
|
@@ -14003,10 +14005,16 @@ ${lanes.join("\n")}
|
|
|
14003
14005
|
case 216 /* ArrowFunction */:
|
|
14004
14006
|
return getErrorSpanForArrowFunction(sourceFile, node);
|
|
14005
14007
|
case 292 /* CaseClause */:
|
|
14006
|
-
case 293 /* DefaultClause */:
|
|
14008
|
+
case 293 /* DefaultClause */: {
|
|
14007
14009
|
const start = skipTrivia(sourceFile.text, node.pos);
|
|
14008
14010
|
const end = node.statements.length > 0 ? node.statements[0].pos : node.end;
|
|
14009
14011
|
return createTextSpanFromBounds(start, end);
|
|
14012
|
+
}
|
|
14013
|
+
case 250 /* ReturnStatement */:
|
|
14014
|
+
case 226 /* YieldExpression */: {
|
|
14015
|
+
const pos2 = skipTrivia(sourceFile.text, node.pos);
|
|
14016
|
+
return getSpanOfTokenAtPosition(sourceFile, pos2);
|
|
14017
|
+
}
|
|
14010
14018
|
}
|
|
14011
14019
|
if (errorNode === void 0) {
|
|
14012
14020
|
return getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
@@ -14089,6 +14097,7 @@ ${lanes.join("\n")}
|
|
|
14089
14097
|
case 153 /* SymbolKeyword */:
|
|
14090
14098
|
case 149 /* ObjectKeyword */:
|
|
14091
14099
|
case 155 /* UndefinedKeyword */:
|
|
14100
|
+
case 104 /* NullKeyword */:
|
|
14092
14101
|
case 144 /* NeverKeyword */:
|
|
14093
14102
|
return true;
|
|
14094
14103
|
case 114 /* VoidKeyword */:
|
|
@@ -18645,7 +18654,7 @@ ${lanes.join("\n")}
|
|
|
18645
18654
|
result = scanner2.scan();
|
|
18646
18655
|
}
|
|
18647
18656
|
const flags = scanner2.getTokenFlags();
|
|
18648
|
-
return success && result === 9 /* BigIntLiteral */ && scanner2.
|
|
18657
|
+
return success && result === 9 /* BigIntLiteral */ && scanner2.getTokenEnd() === s.length + 1 && !(flags & 512 /* ContainsSeparator */) && (!roundTripOnly || s === pseudoBigIntToString({ negative, base10Value: parsePseudoBigInt(scanner2.getTokenValue()) }));
|
|
18649
18658
|
}
|
|
18650
18659
|
function isValidTypeOnlyAliasUseSite(useSite) {
|
|
18651
18660
|
return !!(useSite.flags & 16777216 /* Ambient */) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
|
|
@@ -28776,13 +28785,13 @@ ${lanes.join("\n")}
|
|
|
28776
28785
|
speculationHelper(() => {
|
|
28777
28786
|
const savedContextFlags = contextFlags;
|
|
28778
28787
|
contextFlags |= 32768 /* AwaitContext */;
|
|
28779
|
-
scanner2.
|
|
28788
|
+
scanner2.resetTokenState(nextStatement.pos);
|
|
28780
28789
|
nextToken();
|
|
28781
28790
|
while (token() !== 1 /* EndOfFileToken */) {
|
|
28782
|
-
const startPos = scanner2.
|
|
28791
|
+
const startPos = scanner2.getTokenFullStart();
|
|
28783
28792
|
const statement = parseListElement(0 /* SourceElements */, parseStatement);
|
|
28784
28793
|
statements.push(statement);
|
|
28785
|
-
if (startPos === scanner2.
|
|
28794
|
+
if (startPos === scanner2.getTokenFullStart()) {
|
|
28786
28795
|
nextToken();
|
|
28787
28796
|
}
|
|
28788
28797
|
if (pos >= 0) {
|
|
@@ -28970,7 +28979,7 @@ ${lanes.join("\n")}
|
|
|
28970
28979
|
return inContext(32768 /* AwaitContext */);
|
|
28971
28980
|
}
|
|
28972
28981
|
function parseErrorAtCurrentToken(message, arg0) {
|
|
28973
|
-
return parseErrorAt(scanner2.
|
|
28982
|
+
return parseErrorAt(scanner2.getTokenStart(), scanner2.getTokenEnd(), message, arg0);
|
|
28974
28983
|
}
|
|
28975
28984
|
function parseErrorAtPosition(start, length2, message, arg0) {
|
|
28976
28985
|
const lastError = lastOrUndefined(parseDiagnostics);
|
|
@@ -28989,10 +28998,10 @@ ${lanes.join("\n")}
|
|
|
28989
28998
|
parseErrorAt(range.pos, range.end, message, arg0);
|
|
28990
28999
|
}
|
|
28991
29000
|
function scanError(message, length2) {
|
|
28992
|
-
parseErrorAtPosition(scanner2.
|
|
29001
|
+
parseErrorAtPosition(scanner2.getTokenEnd(), length2, message);
|
|
28993
29002
|
}
|
|
28994
29003
|
function getNodePos() {
|
|
28995
|
-
return scanner2.
|
|
29004
|
+
return scanner2.getTokenFullStart();
|
|
28996
29005
|
}
|
|
28997
29006
|
function hasPrecedingJSDocComment() {
|
|
28998
29007
|
return scanner2.hasPrecedingJSDocComment();
|
|
@@ -29009,7 +29018,7 @@ ${lanes.join("\n")}
|
|
|
29009
29018
|
}
|
|
29010
29019
|
function nextToken() {
|
|
29011
29020
|
if (isKeyword(currentToken) && (scanner2.hasUnicodeEscape() || scanner2.hasExtendedUnicodeEscape())) {
|
|
29012
|
-
parseErrorAt(scanner2.
|
|
29021
|
+
parseErrorAt(scanner2.getTokenStart(), scanner2.getTokenEnd(), Diagnostics.Keywords_cannot_contain_escape_characters);
|
|
29013
29022
|
}
|
|
29014
29023
|
return nextTokenWithoutCheck();
|
|
29015
29024
|
}
|
|
@@ -29122,7 +29131,7 @@ ${lanes.join("\n")}
|
|
|
29122
29131
|
parseErrorForInvalidName(Diagnostics.Interface_name_cannot_be_0, Diagnostics.Interface_must_be_given_a_name, 18 /* OpenBraceToken */);
|
|
29123
29132
|
return;
|
|
29124
29133
|
case "is":
|
|
29125
|
-
parseErrorAt(pos, scanner2.
|
|
29134
|
+
parseErrorAt(pos, scanner2.getTokenStart(), Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);
|
|
29126
29135
|
return;
|
|
29127
29136
|
case "module":
|
|
29128
29137
|
case "namespace":
|
|
@@ -29277,11 +29286,11 @@ ${lanes.join("\n")}
|
|
|
29277
29286
|
}
|
|
29278
29287
|
function createNodeArray(elements, pos, end, hasTrailingComma) {
|
|
29279
29288
|
const array = factoryCreateNodeArray(elements, hasTrailingComma);
|
|
29280
|
-
setTextRangePosEnd(array, pos, end != null ? end : scanner2.
|
|
29289
|
+
setTextRangePosEnd(array, pos, end != null ? end : scanner2.getTokenFullStart());
|
|
29281
29290
|
return array;
|
|
29282
29291
|
}
|
|
29283
29292
|
function finishNode(node, pos, end) {
|
|
29284
|
-
setTextRangePosEnd(node, pos, end != null ? end : scanner2.
|
|
29293
|
+
setTextRangePosEnd(node, pos, end != null ? end : scanner2.getTokenFullStart());
|
|
29285
29294
|
if (contextFlags) {
|
|
29286
29295
|
node.flags |= contextFlags;
|
|
29287
29296
|
}
|
|
@@ -29293,7 +29302,7 @@ ${lanes.join("\n")}
|
|
|
29293
29302
|
}
|
|
29294
29303
|
function createMissingNode(kind, reportAtCurrentPosition, diagnosticMessage, arg0) {
|
|
29295
29304
|
if (reportAtCurrentPosition) {
|
|
29296
|
-
parseErrorAtPosition(scanner2.
|
|
29305
|
+
parseErrorAtPosition(scanner2.getTokenFullStart(), 0, diagnosticMessage, arg0);
|
|
29297
29306
|
} else if (diagnosticMessage) {
|
|
29298
29307
|
parseErrorAtCurrentToken(diagnosticMessage, arg0);
|
|
29299
29308
|
}
|
|
@@ -29679,7 +29688,7 @@ ${lanes.join("\n")}
|
|
|
29679
29688
|
if (!syntaxCursor || !isReusableParsingContext(parsingContext2) || parseErrorBeforeNextFinishedNode) {
|
|
29680
29689
|
return void 0;
|
|
29681
29690
|
}
|
|
29682
|
-
const node = syntaxCursor.currentNode(pos != null ? pos : scanner2.
|
|
29691
|
+
const node = syntaxCursor.currentNode(pos != null ? pos : scanner2.getTokenFullStart());
|
|
29683
29692
|
if (nodeIsMissing(node) || node.intersectsChange || containsParseError(node)) {
|
|
29684
29693
|
return void 0;
|
|
29685
29694
|
}
|
|
@@ -29696,7 +29705,7 @@ ${lanes.join("\n")}
|
|
|
29696
29705
|
return node;
|
|
29697
29706
|
}
|
|
29698
29707
|
function consumeNode(node) {
|
|
29699
|
-
scanner2.
|
|
29708
|
+
scanner2.resetTokenState(node.end);
|
|
29700
29709
|
nextToken();
|
|
29701
29710
|
return node;
|
|
29702
29711
|
}
|
|
@@ -29910,14 +29919,14 @@ ${lanes.join("\n")}
|
|
|
29910
29919
|
/*inErrorRecovery*/
|
|
29911
29920
|
false
|
|
29912
29921
|
)) {
|
|
29913
|
-
const startPos = scanner2.
|
|
29922
|
+
const startPos = scanner2.getTokenFullStart();
|
|
29914
29923
|
const result = parseListElement(kind, parseElement);
|
|
29915
29924
|
if (!result) {
|
|
29916
29925
|
parsingContext = saveParsingContext;
|
|
29917
29926
|
return void 0;
|
|
29918
29927
|
}
|
|
29919
29928
|
list.push(result);
|
|
29920
|
-
commaStart = scanner2.
|
|
29929
|
+
commaStart = scanner2.getTokenStart();
|
|
29921
29930
|
if (parseOptional(27 /* CommaToken */)) {
|
|
29922
29931
|
continue;
|
|
29923
29932
|
}
|
|
@@ -29929,7 +29938,7 @@ ${lanes.join("\n")}
|
|
|
29929
29938
|
if (considerSemicolonAsDelimiter && token() === 26 /* SemicolonToken */ && !scanner2.hasPrecedingLineBreak()) {
|
|
29930
29939
|
nextToken();
|
|
29931
29940
|
}
|
|
29932
|
-
if (startPos === scanner2.
|
|
29941
|
+
if (startPos === scanner2.getTokenFullStart()) {
|
|
29933
29942
|
nextToken();
|
|
29934
29943
|
}
|
|
29935
29944
|
continue;
|
|
@@ -30758,7 +30767,7 @@ ${lanes.join("\n")}
|
|
|
30758
30767
|
}
|
|
30759
30768
|
function parseImportTypeAssertions() {
|
|
30760
30769
|
const pos = getNodePos();
|
|
30761
|
-
const openBracePosition = scanner2.
|
|
30770
|
+
const openBracePosition = scanner2.getTokenStart();
|
|
30762
30771
|
parseExpected(18 /* OpenBraceToken */);
|
|
30763
30772
|
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
30764
30773
|
parseExpected(130 /* AssertKeyword */);
|
|
@@ -31432,7 +31441,7 @@ ${lanes.join("\n")}
|
|
|
31432
31441
|
}
|
|
31433
31442
|
}
|
|
31434
31443
|
function parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) {
|
|
31435
|
-
const tokenPos = scanner2.
|
|
31444
|
+
const tokenPos = scanner2.getTokenStart();
|
|
31436
31445
|
if (notParenthesizedArrow == null ? void 0 : notParenthesizedArrow.has(tokenPos)) {
|
|
31437
31446
|
return void 0;
|
|
31438
31447
|
}
|
|
@@ -32331,7 +32340,7 @@ ${lanes.join("\n")}
|
|
|
32331
32340
|
}
|
|
32332
32341
|
function parseArrayLiteralExpression() {
|
|
32333
32342
|
const pos = getNodePos();
|
|
32334
|
-
const openBracketPosition = scanner2.
|
|
32343
|
+
const openBracketPosition = scanner2.getTokenStart();
|
|
32335
32344
|
const openBracketParsed = parseExpected(22 /* OpenBracketToken */);
|
|
32336
32345
|
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
32337
32346
|
const elements = parseDelimitedList(15 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement);
|
|
@@ -32391,7 +32400,7 @@ ${lanes.join("\n")}
|
|
|
32391
32400
|
}
|
|
32392
32401
|
function parseObjectLiteralExpression() {
|
|
32393
32402
|
const pos = getNodePos();
|
|
32394
|
-
const openBracePosition = scanner2.
|
|
32403
|
+
const openBracePosition = scanner2.getTokenStart();
|
|
32395
32404
|
const openBraceParsed = parseExpected(18 /* OpenBraceToken */);
|
|
32396
32405
|
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
32397
32406
|
const properties = parseDelimitedList(
|
|
@@ -32463,7 +32472,7 @@ ${lanes.join("\n")}
|
|
|
32463
32472
|
function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
|
|
32464
32473
|
const pos = getNodePos();
|
|
32465
32474
|
const hasJSDoc = hasPrecedingJSDocComment();
|
|
32466
|
-
const openBracePosition = scanner2.
|
|
32475
|
+
const openBracePosition = scanner2.getTokenStart();
|
|
32467
32476
|
const openBraceParsed = parseExpected(18 /* OpenBraceToken */, diagnosticMessage);
|
|
32468
32477
|
if (openBraceParsed || ignoreMissingOpenBrace) {
|
|
32469
32478
|
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
@@ -32520,7 +32529,7 @@ ${lanes.join("\n")}
|
|
|
32520
32529
|
const pos = getNodePos();
|
|
32521
32530
|
const hasJSDoc = hasPrecedingJSDocComment();
|
|
32522
32531
|
parseExpected(99 /* IfKeyword */);
|
|
32523
|
-
const openParenPosition = scanner2.
|
|
32532
|
+
const openParenPosition = scanner2.getTokenStart();
|
|
32524
32533
|
const openParenParsed = parseExpected(20 /* OpenParenToken */);
|
|
32525
32534
|
const expression = allowInAnd(parseExpression);
|
|
32526
32535
|
parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition);
|
|
@@ -32534,7 +32543,7 @@ ${lanes.join("\n")}
|
|
|
32534
32543
|
parseExpected(90 /* DoKeyword */);
|
|
32535
32544
|
const statement = parseStatement();
|
|
32536
32545
|
parseExpected(115 /* WhileKeyword */);
|
|
32537
|
-
const openParenPosition = scanner2.
|
|
32546
|
+
const openParenPosition = scanner2.getTokenStart();
|
|
32538
32547
|
const openParenParsed = parseExpected(20 /* OpenParenToken */);
|
|
32539
32548
|
const expression = allowInAnd(parseExpression);
|
|
32540
32549
|
parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition);
|
|
@@ -32545,7 +32554,7 @@ ${lanes.join("\n")}
|
|
|
32545
32554
|
const pos = getNodePos();
|
|
32546
32555
|
const hasJSDoc = hasPrecedingJSDocComment();
|
|
32547
32556
|
parseExpected(115 /* WhileKeyword */);
|
|
32548
|
-
const openParenPosition = scanner2.
|
|
32557
|
+
const openParenPosition = scanner2.getTokenStart();
|
|
32549
32558
|
const openParenParsed = parseExpected(20 /* OpenParenToken */);
|
|
32550
32559
|
const expression = allowInAnd(parseExpression);
|
|
32551
32560
|
parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition);
|
|
@@ -32612,7 +32621,7 @@ ${lanes.join("\n")}
|
|
|
32612
32621
|
const pos = getNodePos();
|
|
32613
32622
|
const hasJSDoc = hasPrecedingJSDocComment();
|
|
32614
32623
|
parseExpected(116 /* WithKeyword */);
|
|
32615
|
-
const openParenPosition = scanner2.
|
|
32624
|
+
const openParenPosition = scanner2.getTokenStart();
|
|
32616
32625
|
const openParenParsed = parseExpected(20 /* OpenParenToken */);
|
|
32617
32626
|
const expression = allowInAnd(parseExpression);
|
|
32618
32627
|
parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition);
|
|
@@ -33708,7 +33717,7 @@ ${lanes.join("\n")}
|
|
|
33708
33717
|
}
|
|
33709
33718
|
function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiers) {
|
|
33710
33719
|
parseExpected(100 /* ImportKeyword */);
|
|
33711
|
-
const afterImportPos = scanner2.
|
|
33720
|
+
const afterImportPos = scanner2.getTokenFullStart();
|
|
33712
33721
|
let identifier;
|
|
33713
33722
|
if (isIdentifier2()) {
|
|
33714
33723
|
identifier = parseIdentifier();
|
|
@@ -33752,7 +33761,7 @@ ${lanes.join("\n")}
|
|
|
33752
33761
|
if (!skipAssertKeyword) {
|
|
33753
33762
|
parseExpected(130 /* AssertKeyword */);
|
|
33754
33763
|
}
|
|
33755
|
-
const openBracePosition = scanner2.
|
|
33764
|
+
const openBracePosition = scanner2.getTokenStart();
|
|
33756
33765
|
if (parseExpected(18 /* OpenBraceToken */)) {
|
|
33757
33766
|
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
33758
33767
|
const elements = parseDelimitedList(
|
|
@@ -33853,8 +33862,8 @@ ${lanes.join("\n")}
|
|
|
33853
33862
|
function parseImportOrExportSpecifier(kind) {
|
|
33854
33863
|
const pos = getNodePos();
|
|
33855
33864
|
let checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2();
|
|
33856
|
-
let checkIdentifierStart = scanner2.
|
|
33857
|
-
let checkIdentifierEnd = scanner2.
|
|
33865
|
+
let checkIdentifierStart = scanner2.getTokenStart();
|
|
33866
|
+
let checkIdentifierEnd = scanner2.getTokenEnd();
|
|
33858
33867
|
let isTypeOnly = false;
|
|
33859
33868
|
let propertyName;
|
|
33860
33869
|
let canParseAsKeyword = true;
|
|
@@ -33899,8 +33908,8 @@ ${lanes.join("\n")}
|
|
|
33899
33908
|
return finishNode(node, pos);
|
|
33900
33909
|
function parseNameWithKeywordCheck() {
|
|
33901
33910
|
checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2();
|
|
33902
|
-
checkIdentifierStart = scanner2.
|
|
33903
|
-
checkIdentifierEnd = scanner2.
|
|
33911
|
+
checkIdentifierStart = scanner2.getTokenStart();
|
|
33912
|
+
checkIdentifierEnd = scanner2.getTokenEnd();
|
|
33904
33913
|
return parseIdentifierName();
|
|
33905
33914
|
}
|
|
33906
33915
|
}
|
|
@@ -34186,8 +34195,8 @@ ${lanes.join("\n")}
|
|
|
34186
34195
|
break loop;
|
|
34187
34196
|
case 18 /* OpenBraceToken */:
|
|
34188
34197
|
state = 2 /* SavingComments */;
|
|
34189
|
-
const commentEnd = scanner2.
|
|
34190
|
-
const linkStart = scanner2.
|
|
34198
|
+
const commentEnd = scanner2.getTokenFullStart();
|
|
34199
|
+
const linkStart = scanner2.getTokenEnd() - 1;
|
|
34191
34200
|
const link = parseJSDocLink(linkStart);
|
|
34192
34201
|
if (link) {
|
|
34193
34202
|
if (!linkEnd) {
|
|
@@ -34196,7 +34205,7 @@ ${lanes.join("\n")}
|
|
|
34196
34205
|
parts.push(finishNode(factory2.createJSDocText(comments.join("")), linkEnd != null ? linkEnd : start, commentEnd));
|
|
34197
34206
|
parts.push(link);
|
|
34198
34207
|
comments = [];
|
|
34199
|
-
linkEnd = scanner2.
|
|
34208
|
+
linkEnd = scanner2.getTokenEnd();
|
|
34200
34209
|
break;
|
|
34201
34210
|
}
|
|
34202
34211
|
default:
|
|
@@ -34270,7 +34279,7 @@ ${lanes.join("\n")}
|
|
|
34270
34279
|
}
|
|
34271
34280
|
function parseTag(margin) {
|
|
34272
34281
|
Debug.assert(token() === 59 /* AtToken */);
|
|
34273
|
-
const start2 = scanner2.
|
|
34282
|
+
const start2 = scanner2.getTokenStart();
|
|
34274
34283
|
nextTokenJSDoc();
|
|
34275
34284
|
const tagName = parseJSDocIdentifierName(
|
|
34276
34285
|
/*message*/
|
|
@@ -34398,7 +34407,7 @@ ${lanes.join("\n")}
|
|
|
34398
34407
|
comments2.push(scanner2.getTokenText());
|
|
34399
34408
|
break;
|
|
34400
34409
|
}
|
|
34401
|
-
scanner2.
|
|
34410
|
+
scanner2.resetTokenState(scanner2.getTokenEnd() - 1);
|
|
34402
34411
|
case 1 /* EndOfFileToken */:
|
|
34403
34412
|
break loop;
|
|
34404
34413
|
case 5 /* WhitespaceTrivia */:
|
|
@@ -34414,14 +34423,14 @@ ${lanes.join("\n")}
|
|
|
34414
34423
|
break;
|
|
34415
34424
|
case 18 /* OpenBraceToken */:
|
|
34416
34425
|
state = 2 /* SavingComments */;
|
|
34417
|
-
const commentEnd = scanner2.
|
|
34418
|
-
const linkStart = scanner2.
|
|
34426
|
+
const commentEnd = scanner2.getTokenFullStart();
|
|
34427
|
+
const linkStart = scanner2.getTokenEnd() - 1;
|
|
34419
34428
|
const link = parseJSDocLink(linkStart);
|
|
34420
34429
|
if (link) {
|
|
34421
34430
|
parts2.push(finishNode(factory2.createJSDocText(comments2.join("")), linkEnd2 != null ? linkEnd2 : commentsPos2, commentEnd));
|
|
34422
34431
|
parts2.push(link);
|
|
34423
34432
|
comments2 = [];
|
|
34424
|
-
linkEnd2 = scanner2.
|
|
34433
|
+
linkEnd2 = scanner2.getTokenEnd();
|
|
34425
34434
|
} else {
|
|
34426
34435
|
pushComment(scanner2.getTokenText());
|
|
34427
34436
|
}
|
|
@@ -34456,7 +34465,7 @@ ${lanes.join("\n")}
|
|
|
34456
34465
|
if (comments2.length) {
|
|
34457
34466
|
parts2.push(finishNode(factory2.createJSDocText(comments2.join("")), linkEnd2 != null ? linkEnd2 : commentsPos2));
|
|
34458
34467
|
}
|
|
34459
|
-
return createNodeArray(parts2, commentsPos2, scanner2.
|
|
34468
|
+
return createNodeArray(parts2, commentsPos2, scanner2.getTokenEnd());
|
|
34460
34469
|
} else if (comments2.length) {
|
|
34461
34470
|
return comments2.join("");
|
|
34462
34471
|
}
|
|
@@ -34490,7 +34499,7 @@ ${lanes.join("\n")}
|
|
|
34490
34499
|
nextTokenJSDoc();
|
|
34491
34500
|
}
|
|
34492
34501
|
const create = linkType === "link" ? factory2.createJSDocLink : linkType === "linkcode" ? factory2.createJSDocLinkCode : factory2.createJSDocLinkPlain;
|
|
34493
|
-
return finishNode(create(name, text.join("")), start2, scanner2.
|
|
34502
|
+
return finishNode(create(name, text.join("")), start2, scanner2.getTokenEnd());
|
|
34494
34503
|
}
|
|
34495
34504
|
function parseJSDocLinkPrefix() {
|
|
34496
34505
|
skipWhitespaceOrAsterisk();
|
|
@@ -34587,14 +34596,14 @@ ${lanes.join("\n")}
|
|
|
34587
34596
|
}
|
|
34588
34597
|
function parseReturnTag(start2, tagName, indent3, indentText) {
|
|
34589
34598
|
if (some(tags, isJSDocReturnTag)) {
|
|
34590
|
-
parseErrorAt(tagName.pos, scanner2.
|
|
34599
|
+
parseErrorAt(tagName.pos, scanner2.getTokenStart(), Diagnostics._0_tag_already_specified, tagName.escapedText);
|
|
34591
34600
|
}
|
|
34592
34601
|
const typeExpression = tryParseTypeExpression();
|
|
34593
34602
|
return finishNode(factory2.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), indent3, indentText)), start2);
|
|
34594
34603
|
}
|
|
34595
34604
|
function parseTypeTag(start2, tagName, indent3, indentText) {
|
|
34596
34605
|
if (some(tags, isJSDocTypeTag)) {
|
|
34597
|
-
parseErrorAt(tagName.pos, scanner2.
|
|
34606
|
+
parseErrorAt(tagName.pos, scanner2.getTokenStart(), Diagnostics._0_tag_already_specified, tagName.escapedText);
|
|
34598
34607
|
}
|
|
34599
34608
|
const typeExpression = parseJSDocTypeExpression(
|
|
34600
34609
|
/*mayOmitBraces*/
|
|
@@ -34617,10 +34626,10 @@ ${lanes.join("\n")}
|
|
|
34617
34626
|
function parseAuthorTag(start2, tagName, indent3, indentText) {
|
|
34618
34627
|
const commentStart = getNodePos();
|
|
34619
34628
|
const textOnly = parseAuthorNameAndEmail();
|
|
34620
|
-
let commentEnd = scanner2.
|
|
34629
|
+
let commentEnd = scanner2.getTokenFullStart();
|
|
34621
34630
|
const comments2 = parseTrailingTagComments(start2, commentEnd, indent3, indentText);
|
|
34622
34631
|
if (!comments2) {
|
|
34623
|
-
commentEnd = scanner2.
|
|
34632
|
+
commentEnd = scanner2.getTokenFullStart();
|
|
34624
34633
|
}
|
|
34625
34634
|
const allParts = typeof comments2 !== "string" ? createNodeArray(concatenate([finishNode(textOnly, commentStart, commentEnd)], comments2), commentStart) : textOnly.text + comments2;
|
|
34626
34635
|
return finishNode(factory2.createJSDocAuthorTag(tagName, allParts), start2);
|
|
@@ -34636,7 +34645,7 @@ ${lanes.join("\n")}
|
|
|
34636
34645
|
break;
|
|
34637
34646
|
} else if (token2 === 31 /* GreaterThanToken */ && inEmail) {
|
|
34638
34647
|
comments2.push(scanner2.getTokenText());
|
|
34639
|
-
scanner2.
|
|
34648
|
+
scanner2.resetTokenState(scanner2.getTokenEnd());
|
|
34640
34649
|
break;
|
|
34641
34650
|
}
|
|
34642
34651
|
comments2.push(scanner2.getTokenText());
|
|
@@ -34744,7 +34753,7 @@ ${lanes.join("\n")}
|
|
|
34744
34753
|
return finishNode(typedefTag, start2, end2);
|
|
34745
34754
|
}
|
|
34746
34755
|
function parseJSDocTypeNameWithNamespace(nested) {
|
|
34747
|
-
const
|
|
34756
|
+
const start2 = scanner2.getTokenStart();
|
|
34748
34757
|
if (!tokenIsIdentifierOrKeyword(token())) {
|
|
34749
34758
|
return void 0;
|
|
34750
34759
|
}
|
|
@@ -34761,7 +34770,7 @@ ${lanes.join("\n")}
|
|
|
34761
34770
|
body,
|
|
34762
34771
|
nested ? 4 /* NestedNamespace */ : void 0
|
|
34763
34772
|
);
|
|
34764
|
-
return finishNode(jsDocNamespaceNode,
|
|
34773
|
+
return finishNode(jsDocNamespaceNode, start2);
|
|
34765
34774
|
}
|
|
34766
34775
|
if (nested) {
|
|
34767
34776
|
typeNameOrNamespaceName.flags |= 2048 /* IdentifierIsInJSDocNamespace */;
|
|
@@ -34864,7 +34873,7 @@ ${lanes.join("\n")}
|
|
|
34864
34873
|
}
|
|
34865
34874
|
function tryParseChildTag(target, indent3) {
|
|
34866
34875
|
Debug.assert(token() === 59 /* AtToken */);
|
|
34867
|
-
const start2 = scanner2.
|
|
34876
|
+
const start2 = scanner2.getTokenFullStart();
|
|
34868
34877
|
nextTokenJSDoc();
|
|
34869
34878
|
const tagName = parseJSDocIdentifierName();
|
|
34870
34879
|
skipWhitespace();
|
|
@@ -34964,11 +34973,11 @@ ${lanes.join("\n")}
|
|
|
34964
34973
|
);
|
|
34965
34974
|
}
|
|
34966
34975
|
identifierCount++;
|
|
34967
|
-
const
|
|
34968
|
-
const end2 = scanner2.
|
|
34976
|
+
const start2 = scanner2.getTokenStart();
|
|
34977
|
+
const end2 = scanner2.getTokenEnd();
|
|
34969
34978
|
const originalKeywordKind = token();
|
|
34970
34979
|
const text = internIdentifier(scanner2.getTokenValue());
|
|
34971
|
-
const result = finishNode(factoryCreateIdentifier(text, originalKeywordKind),
|
|
34980
|
+
const result = finishNode(factoryCreateIdentifier(text, originalKeywordKind), start2, end2);
|
|
34972
34981
|
nextTokenJSDoc();
|
|
34973
34982
|
return result;
|
|
34974
34983
|
}
|
|
@@ -44053,7 +44062,7 @@ ${lanes.join("\n")}
|
|
|
44053
44062
|
ModuleInstanceState2[ModuleInstanceState2["ConstEnumOnly"] = 2] = "ConstEnumOnly";
|
|
44054
44063
|
return ModuleInstanceState2;
|
|
44055
44064
|
})(ModuleInstanceState || {});
|
|
44056
|
-
binder = createBinder();
|
|
44065
|
+
binder = /* @__PURE__ */ createBinder();
|
|
44057
44066
|
}
|
|
44058
44067
|
});
|
|
44059
44068
|
|
|
@@ -45317,7 +45326,10 @@ ${lanes.join("\n")}
|
|
|
45317
45326
|
createIndexInfo,
|
|
45318
45327
|
getAnyType: () => anyType,
|
|
45319
45328
|
getStringType: () => stringType,
|
|
45329
|
+
getStringLiteralType,
|
|
45320
45330
|
getNumberType: () => numberType,
|
|
45331
|
+
getNumberLiteralType,
|
|
45332
|
+
getBigIntType: () => bigintType,
|
|
45321
45333
|
createPromiseType,
|
|
45322
45334
|
createArrayType,
|
|
45323
45335
|
getElementTypeOfArrayType,
|
|
@@ -54724,9 +54736,14 @@ ${lanes.join("\n")}
|
|
|
54724
54736
|
return result;
|
|
54725
54737
|
}
|
|
54726
54738
|
function addInheritedMembers(symbols, baseSymbols) {
|
|
54727
|
-
for (const
|
|
54728
|
-
if (
|
|
54729
|
-
|
|
54739
|
+
for (const base of baseSymbols) {
|
|
54740
|
+
if (isStaticPrivateIdentifierProperty(base)) {
|
|
54741
|
+
continue;
|
|
54742
|
+
}
|
|
54743
|
+
const derived = symbols.get(base.escapedName);
|
|
54744
|
+
if (!derived || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration) && !isConstructorDeclaredProperty(derived) && !getContainingClassStaticBlock(derived.valueDeclaration)) {
|
|
54745
|
+
symbols.set(base.escapedName, base);
|
|
54746
|
+
symbols.set(base.escapedName, base);
|
|
54730
54747
|
}
|
|
54731
54748
|
}
|
|
54732
54749
|
}
|
|
@@ -58649,12 +58666,15 @@ ${lanes.join("\n")}
|
|
|
58649
58666
|
function getConstituentCountOfTypes(types) {
|
|
58650
58667
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
58651
58668
|
}
|
|
58669
|
+
function areIntersectedTypesAvoidingPrimitiveReduction(t1, t2) {
|
|
58670
|
+
return !!(t1.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) && t2 === emptyTypeLiteralType;
|
|
58671
|
+
}
|
|
58652
58672
|
function getTypeFromIntersectionTypeNode(node) {
|
|
58653
58673
|
const links = getNodeLinks(node);
|
|
58654
58674
|
if (!links.resolvedType) {
|
|
58655
58675
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
58656
58676
|
const types = map(node.types, getTypeFromTypeNode);
|
|
58657
|
-
const noSupertypeReduction = types.length === 2 &&
|
|
58677
|
+
const noSupertypeReduction = types.length === 2 && (areIntersectedTypesAvoidingPrimitiveReduction(types[0], types[1]) || areIntersectedTypesAvoidingPrimitiveReduction(types[1], types[0]));
|
|
58658
58678
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
58659
58679
|
}
|
|
58660
58680
|
return links.resolvedType;
|
|
@@ -62027,8 +62047,8 @@ ${lanes.join("\n")}
|
|
|
62027
62047
|
if (prop.valueDeclaration && findAncestor(prop.valueDeclaration, (d) => d === objectLiteralDeclaration) && getSourceFileOfNode(objectLiteralDeclaration) === getSourceFileOfNode(errorNode)) {
|
|
62028
62048
|
const propDeclaration = prop.valueDeclaration;
|
|
62029
62049
|
Debug.assertNode(propDeclaration, isObjectLiteralElementLike);
|
|
62030
|
-
errorNode = propDeclaration;
|
|
62031
62050
|
const name = propDeclaration.name;
|
|
62051
|
+
errorNode = name;
|
|
62032
62052
|
if (isIdentifier(name)) {
|
|
62033
62053
|
suggestion = getSuggestionForNonexistentProperty(name, errorTarget);
|
|
62034
62054
|
}
|
|
@@ -69614,13 +69634,14 @@ ${lanes.join("\n")}
|
|
|
69614
69634
|
const elementFlags = [];
|
|
69615
69635
|
pushCachedContextualType(node);
|
|
69616
69636
|
const inDestructuringPattern = isAssignmentTarget(node);
|
|
69617
|
-
const
|
|
69637
|
+
const isSpreadIntoCallOrNew = isSpreadElement(node.parent) && isCallOrNewExpression(node.parent.parent);
|
|
69638
|
+
const inConstContext = isSpreadIntoCallOrNew || isConstContext(node);
|
|
69618
69639
|
const contextualType = getApparentTypeOfContextualType(
|
|
69619
69640
|
node,
|
|
69620
69641
|
/*contextFlags*/
|
|
69621
69642
|
void 0
|
|
69622
69643
|
);
|
|
69623
|
-
const inTupleContext = !!contextualType && someType(contextualType, isTupleLikeType);
|
|
69644
|
+
const inTupleContext = isSpreadIntoCallOrNew || !!contextualType && someType(contextualType, isTupleLikeType);
|
|
69624
69645
|
let hasOmittedExpression = false;
|
|
69625
69646
|
for (let i = 0; i < elementCount; i++) {
|
|
69626
69647
|
const e = elements[i];
|
|
@@ -76791,7 +76812,7 @@ ${lanes.join("\n")}
|
|
|
76791
76812
|
return !!forEachChild(node, nodeImmediatelyReferencesSuperOrThis);
|
|
76792
76813
|
}
|
|
76793
76814
|
function checkAccessorDeclaration(node) {
|
|
76794
|
-
if (isIdentifier(node.name) && idText(node.name) === "constructor") {
|
|
76815
|
+
if (isIdentifier(node.name) && idText(node.name) === "constructor" && isClassLike(node.parent)) {
|
|
76795
76816
|
error(node.name, Diagnostics.Class_constructor_may_not_be_an_accessor);
|
|
76796
76817
|
}
|
|
76797
76818
|
addLazyDiagnostic(checkAccessorDeclarationDiagnostics);
|
|
@@ -115806,6 +115827,7 @@ ${lanes.join("\n")}
|
|
|
115806
115827
|
const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions;
|
|
115807
115828
|
const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3 } = createProgramOptions;
|
|
115808
115829
|
let { oldProgram } = createProgramOptions;
|
|
115830
|
+
const reportInvalidIgnoreDeprecations = memoize(() => createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations));
|
|
115809
115831
|
let processingDefaultLibFiles;
|
|
115810
115832
|
let processingOtherFiles;
|
|
115811
115833
|
let files;
|
|
@@ -118232,127 +118254,131 @@ ${lanes.join("\n")}
|
|
|
118232
118254
|
}
|
|
118233
118255
|
}
|
|
118234
118256
|
}
|
|
118235
|
-
function
|
|
118236
|
-
const version2 = typeScriptVersion3 || versionMajorMinor;
|
|
118257
|
+
function getIgnoreDeprecationsVersion() {
|
|
118237
118258
|
const ignoreDeprecations = options.ignoreDeprecations;
|
|
118238
118259
|
if (ignoreDeprecations) {
|
|
118239
|
-
if (ignoreDeprecations === "5.0"
|
|
118240
|
-
return;
|
|
118241
|
-
}
|
|
118242
|
-
|
|
118243
|
-
|
|
118260
|
+
if (ignoreDeprecations === "5.0") {
|
|
118261
|
+
return new Version(ignoreDeprecations);
|
|
118262
|
+
}
|
|
118263
|
+
reportInvalidIgnoreDeprecations();
|
|
118264
|
+
}
|
|
118265
|
+
return Version.zero;
|
|
118266
|
+
}
|
|
118267
|
+
function checkDeprecations(deprecatedIn, removedIn, createDiagnostic, fn) {
|
|
118268
|
+
const deprecatedInVersion = new Version(deprecatedIn);
|
|
118269
|
+
const removedInVersion = new Version(removedIn);
|
|
118270
|
+
const typescriptVersion = new Version(typeScriptVersion3 || versionMajorMinor);
|
|
118271
|
+
const ignoreDeprecationsVersion = getIgnoreDeprecationsVersion();
|
|
118272
|
+
const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion) === 1 /* GreaterThan */);
|
|
118273
|
+
const canBeSilenced = !mustBeRemoved && ignoreDeprecationsVersion.compareTo(deprecatedInVersion) === -1 /* LessThan */;
|
|
118274
|
+
if (mustBeRemoved || canBeSilenced) {
|
|
118275
|
+
fn((name, value, useInstead) => {
|
|
118276
|
+
if (mustBeRemoved) {
|
|
118277
|
+
if (value === void 0) {
|
|
118278
|
+
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name);
|
|
118279
|
+
} else {
|
|
118280
|
+
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name, value);
|
|
118281
|
+
}
|
|
118282
|
+
} else {
|
|
118283
|
+
if (value === void 0) {
|
|
118284
|
+
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn);
|
|
118285
|
+
} else {
|
|
118286
|
+
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn);
|
|
118287
|
+
}
|
|
118288
|
+
}
|
|
118289
|
+
});
|
|
118244
118290
|
}
|
|
118245
|
-
return version2;
|
|
118246
118291
|
}
|
|
118247
118292
|
function verifyDeprecatedCompilerOptions() {
|
|
118248
|
-
|
|
118249
|
-
|
|
118250
|
-
|
|
118251
|
-
|
|
118252
|
-
|
|
118253
|
-
|
|
118254
|
-
|
|
118255
|
-
|
|
118256
|
-
|
|
118257
|
-
|
|
118258
|
-
|
|
118259
|
-
|
|
118260
|
-
|
|
118261
|
-
|
|
118262
|
-
|
|
118263
|
-
|
|
118264
|
-
|
|
118265
|
-
|
|
118266
|
-
|
|
118267
|
-
|
|
118268
|
-
|
|
118269
|
-
|
|
118270
|
-
|
|
118271
|
-
|
|
118272
|
-
|
|
118273
|
-
|
|
118274
|
-
|
|
118275
|
-
|
|
118276
|
-
|
|
118277
|
-
}
|
|
118278
|
-
if (options.importsNotUsedAsValues) {
|
|
118279
|
-
createDeprecatedDiagnosticForOption(
|
|
118280
|
-
version2,
|
|
118281
|
-
"importsNotUsedAsValues",
|
|
118282
|
-
/*value*/
|
|
118283
|
-
void 0,
|
|
118284
|
-
"verbatimModuleSyntax"
|
|
118285
|
-
);
|
|
118286
|
-
}
|
|
118287
|
-
if (options.preserveValueImports) {
|
|
118288
|
-
createDeprecatedDiagnosticForOption(
|
|
118289
|
-
version2,
|
|
118290
|
-
"preserveValueImports",
|
|
118291
|
-
/*value*/
|
|
118292
|
-
void 0,
|
|
118293
|
-
"verbatimModuleSyntax"
|
|
118294
|
-
);
|
|
118295
|
-
}
|
|
118296
|
-
}
|
|
118297
|
-
function verifyDeprecatedProjectReference(ref, parentFile, index) {
|
|
118298
|
-
if (ref.prepend) {
|
|
118299
|
-
const version2 = getVersionForDeprecationDiagnostics(
|
|
118300
|
-
/*reportInvalidIgnoreDeprecations*/
|
|
118301
|
-
false
|
|
118302
|
-
);
|
|
118303
|
-
if (version2) {
|
|
118304
|
-
createDeprecatedOptionForVersionDiagnostic(
|
|
118305
|
-
version2,
|
|
118306
|
-
(message, arg0, arg1, arg2) => createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2),
|
|
118307
|
-
"prepend"
|
|
118293
|
+
function createDiagnostic(name, value, useInstead, message, arg0, arg1, arg2, arg3) {
|
|
118294
|
+
if (useInstead) {
|
|
118295
|
+
const details = chainDiagnosticMessages(
|
|
118296
|
+
/*details*/
|
|
118297
|
+
void 0,
|
|
118298
|
+
Diagnostics.Use_0_instead,
|
|
118299
|
+
useInstead
|
|
118300
|
+
);
|
|
118301
|
+
const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2, arg3);
|
|
118302
|
+
createDiagnosticForOption(
|
|
118303
|
+
/*onKey*/
|
|
118304
|
+
!value,
|
|
118305
|
+
name,
|
|
118306
|
+
/*option2*/
|
|
118307
|
+
void 0,
|
|
118308
|
+
chain
|
|
118309
|
+
);
|
|
118310
|
+
} else {
|
|
118311
|
+
createDiagnosticForOption(
|
|
118312
|
+
/*onKey*/
|
|
118313
|
+
!value,
|
|
118314
|
+
name,
|
|
118315
|
+
/*option2*/
|
|
118316
|
+
void 0,
|
|
118317
|
+
message,
|
|
118318
|
+
arg0,
|
|
118319
|
+
arg1,
|
|
118320
|
+
arg2,
|
|
118321
|
+
arg3
|
|
118308
118322
|
);
|
|
118309
118323
|
}
|
|
118310
118324
|
}
|
|
118325
|
+
checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => {
|
|
118326
|
+
if (options.target === 0 /* ES3 */) {
|
|
118327
|
+
createDeprecatedDiagnostic("target", "ES3");
|
|
118328
|
+
}
|
|
118329
|
+
if (options.noImplicitUseStrict) {
|
|
118330
|
+
createDeprecatedDiagnostic("noImplicitUseStrict");
|
|
118331
|
+
}
|
|
118332
|
+
if (options.keyofStringsOnly) {
|
|
118333
|
+
createDeprecatedDiagnostic("keyofStringsOnly");
|
|
118334
|
+
}
|
|
118335
|
+
if (options.suppressExcessPropertyErrors) {
|
|
118336
|
+
createDeprecatedDiagnostic("suppressExcessPropertyErrors");
|
|
118337
|
+
}
|
|
118338
|
+
if (options.suppressImplicitAnyIndexErrors) {
|
|
118339
|
+
createDeprecatedDiagnostic("suppressImplicitAnyIndexErrors");
|
|
118340
|
+
}
|
|
118341
|
+
if (options.noStrictGenericChecks) {
|
|
118342
|
+
createDeprecatedDiagnostic("noStrictGenericChecks");
|
|
118343
|
+
}
|
|
118344
|
+
if (options.charset) {
|
|
118345
|
+
createDeprecatedDiagnostic("charset");
|
|
118346
|
+
}
|
|
118347
|
+
if (options.out) {
|
|
118348
|
+
createDeprecatedDiagnostic(
|
|
118349
|
+
"out",
|
|
118350
|
+
/*value*/
|
|
118351
|
+
void 0,
|
|
118352
|
+
"outFile"
|
|
118353
|
+
);
|
|
118354
|
+
}
|
|
118355
|
+
if (options.importsNotUsedAsValues) {
|
|
118356
|
+
createDeprecatedDiagnostic(
|
|
118357
|
+
"importsNotUsedAsValues",
|
|
118358
|
+
/*value*/
|
|
118359
|
+
void 0,
|
|
118360
|
+
"verbatimModuleSyntax"
|
|
118361
|
+
);
|
|
118362
|
+
}
|
|
118363
|
+
if (options.preserveValueImports) {
|
|
118364
|
+
createDeprecatedDiagnostic(
|
|
118365
|
+
"preserveValueImports",
|
|
118366
|
+
/*value*/
|
|
118367
|
+
void 0,
|
|
118368
|
+
"verbatimModuleSyntax"
|
|
118369
|
+
);
|
|
118370
|
+
}
|
|
118371
|
+
});
|
|
118311
118372
|
}
|
|
118312
|
-
function
|
|
118313
|
-
|
|
118314
|
-
|
|
118315
|
-
(message, arg0, arg1, arg2) => {
|
|
118316
|
-
if (useInstead) {
|
|
118317
|
-
const details = chainDiagnosticMessages(
|
|
118318
|
-
/*details*/
|
|
118319
|
-
void 0,
|
|
118320
|
-
Diagnostics.Use_0_instead,
|
|
118321
|
-
useInstead
|
|
118322
|
-
);
|
|
118323
|
-
const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2);
|
|
118324
|
-
createDiagnosticForOption(
|
|
118325
|
-
/*onKey*/
|
|
118326
|
-
!value,
|
|
118327
|
-
name,
|
|
118328
|
-
/*option2*/
|
|
118329
|
-
void 0,
|
|
118330
|
-
chain
|
|
118331
|
-
);
|
|
118332
|
-
} else {
|
|
118333
|
-
createDiagnosticForOption(
|
|
118334
|
-
/*onKey*/
|
|
118335
|
-
!value,
|
|
118336
|
-
name,
|
|
118337
|
-
/*option2*/
|
|
118338
|
-
void 0,
|
|
118339
|
-
message,
|
|
118340
|
-
arg0,
|
|
118341
|
-
arg1,
|
|
118342
|
-
arg2
|
|
118343
|
-
);
|
|
118344
|
-
}
|
|
118345
|
-
},
|
|
118346
|
-
name,
|
|
118347
|
-
value
|
|
118348
|
-
);
|
|
118349
|
-
}
|
|
118350
|
-
function createDeprecatedOptionForVersionDiagnostic(version2, createDiagnostic, name, value) {
|
|
118351
|
-
if (version2 === "6.0" /* v6_0 */) {
|
|
118352
|
-
createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name);
|
|
118353
|
-
} else {
|
|
118354
|
-
createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */);
|
|
118373
|
+
function verifyDeprecatedProjectReference(ref, parentFile, index) {
|
|
118374
|
+
function createDiagnostic(_name, _value, _useInstead, message, arg0, arg1, arg2, arg3) {
|
|
118375
|
+
createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2, arg3);
|
|
118355
118376
|
}
|
|
118377
|
+
checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => {
|
|
118378
|
+
if (ref.prepend) {
|
|
118379
|
+
createDeprecatedDiagnostic("prepend");
|
|
118380
|
+
}
|
|
118381
|
+
});
|
|
118356
118382
|
}
|
|
118357
118383
|
function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) {
|
|
118358
118384
|
var _a3;
|
|
@@ -118605,25 +118631,25 @@ ${lanes.join("\n")}
|
|
|
118605
118631
|
arg1
|
|
118606
118632
|
);
|
|
118607
118633
|
}
|
|
118608
|
-
function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2) {
|
|
118634
|
+
function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2, arg3) {
|
|
118609
118635
|
const referencesSyntax = firstDefined(
|
|
118610
118636
|
getTsConfigPropArray(sourceFile || options.configFile, "references"),
|
|
118611
118637
|
(property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0
|
|
118612
118638
|
);
|
|
118613
118639
|
if (referencesSyntax && referencesSyntax.elements.length > index) {
|
|
118614
|
-
programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2));
|
|
118640
|
+
programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2, arg3));
|
|
118615
118641
|
} else {
|
|
118616
|
-
programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2));
|
|
118642
|
+
programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3));
|
|
118617
118643
|
}
|
|
118618
118644
|
}
|
|
118619
|
-
function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2) {
|
|
118645
|
+
function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2, arg3) {
|
|
118620
118646
|
const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax();
|
|
118621
|
-
const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2);
|
|
118647
|
+
const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2, arg3);
|
|
118622
118648
|
if (needCompilerDiagnostic) {
|
|
118623
118649
|
if ("messageText" in message) {
|
|
118624
118650
|
programDiagnostics.add(createCompilerDiagnosticFromMessageChain(message));
|
|
118625
118651
|
} else {
|
|
118626
|
-
programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2));
|
|
118652
|
+
programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3));
|
|
118627
118653
|
}
|
|
118628
118654
|
}
|
|
118629
118655
|
}
|
|
@@ -118642,13 +118668,13 @@ ${lanes.join("\n")}
|
|
|
118642
118668
|
}
|
|
118643
118669
|
return _compilerOptionsObjectLiteralSyntax || void 0;
|
|
118644
118670
|
}
|
|
118645
|
-
function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2) {
|
|
118671
|
+
function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2, arg3) {
|
|
118646
118672
|
const props = getPropertyAssignment(objectLiteral, key1, key2);
|
|
118647
118673
|
for (const prop of props) {
|
|
118648
118674
|
if ("messageText" in message) {
|
|
118649
118675
|
programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message));
|
|
118650
118676
|
} else {
|
|
118651
|
-
programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2));
|
|
118677
|
+
programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2, arg3));
|
|
118652
118678
|
}
|
|
118653
118679
|
}
|
|
118654
118680
|
return !!props.length;
|
|
@@ -127136,12 +127162,15 @@ ${lanes.join("\n")}
|
|
|
127136
127162
|
}
|
|
127137
127163
|
return false;
|
|
127138
127164
|
}
|
|
127165
|
+
function areIntersectedTypesAvoidingStringReduction(checker, t1, t2) {
|
|
127166
|
+
return !!(t1.flags & 4 /* String */) && checker.isEmptyAnonymousObjectType(t2);
|
|
127167
|
+
}
|
|
127139
127168
|
function isStringAndEmptyAnonymousObjectIntersection(type) {
|
|
127140
127169
|
if (!type.isIntersection()) {
|
|
127141
127170
|
return false;
|
|
127142
127171
|
}
|
|
127143
127172
|
const { types, checker } = type;
|
|
127144
|
-
return types.length === 2 && types[0]
|
|
127173
|
+
return types.length === 2 && (areIntersectedTypesAvoidingStringReduction(checker, types[0], types[1]) || areIntersectedTypesAvoidingStringReduction(checker, types[1], types[0]));
|
|
127145
127174
|
}
|
|
127146
127175
|
function isPunctuation(kind) {
|
|
127147
127176
|
return 18 /* FirstPunctuation */ <= kind && kind <= 78 /* LastPunctuation */;
|
|
@@ -129074,8 +129103,8 @@ ${lanes.join("\n")}
|
|
|
129074
129103
|
handleToken();
|
|
129075
129104
|
lastNonTriviaToken = token;
|
|
129076
129105
|
}
|
|
129077
|
-
const end = scanner2.
|
|
129078
|
-
pushEncodedClassification(scanner2.
|
|
129106
|
+
const end = scanner2.getTokenEnd();
|
|
129107
|
+
pushEncodedClassification(scanner2.getTokenStart(), end, offset, classFromKind(token), spans);
|
|
129079
129108
|
if (end >= text.length) {
|
|
129080
129109
|
const end2 = getNewEndOfLineState(scanner2, token, lastOrUndefined(templateStack));
|
|
129081
129110
|
if (end2 !== void 0) {
|
|
@@ -129540,14 +129569,14 @@ ${lanes.join("\n")}
|
|
|
129540
129569
|
result.push(type);
|
|
129541
129570
|
}
|
|
129542
129571
|
function classifyLeadingTriviaAndGetTokenStart(token) {
|
|
129543
|
-
triviaScanner.
|
|
129572
|
+
triviaScanner.resetTokenState(token.pos);
|
|
129544
129573
|
while (true) {
|
|
129545
|
-
const start = triviaScanner.
|
|
129574
|
+
const start = triviaScanner.getTokenEnd();
|
|
129546
129575
|
if (!couldStartTrivia(sourceFile.text, start)) {
|
|
129547
129576
|
return start;
|
|
129548
129577
|
}
|
|
129549
129578
|
const kind = triviaScanner.scan();
|
|
129550
|
-
const end = triviaScanner.
|
|
129579
|
+
const end = triviaScanner.getTokenEnd();
|
|
129551
129580
|
const width = end - start;
|
|
129552
129581
|
if (!isTrivia(kind)) {
|
|
129553
129582
|
return start;
|
|
@@ -129559,7 +129588,7 @@ ${lanes.join("\n")}
|
|
|
129559
129588
|
case 2 /* SingleLineCommentTrivia */:
|
|
129560
129589
|
case 3 /* MultiLineCommentTrivia */:
|
|
129561
129590
|
classifyComment(token, kind, start, width);
|
|
129562
|
-
triviaScanner.
|
|
129591
|
+
triviaScanner.resetTokenState(end);
|
|
129563
129592
|
continue;
|
|
129564
129593
|
case 7 /* ConflictMarkerTrivia */:
|
|
129565
129594
|
const text = sourceFile.text;
|
|
@@ -129758,15 +129787,15 @@ ${lanes.join("\n")}
|
|
|
129758
129787
|
}
|
|
129759
129788
|
}
|
|
129760
129789
|
pushClassification(start, i - start, 1 /* comment */);
|
|
129761
|
-
mergeConflictScanner.
|
|
129762
|
-
while (mergeConflictScanner.
|
|
129790
|
+
mergeConflictScanner.resetTokenState(i);
|
|
129791
|
+
while (mergeConflictScanner.getTokenEnd() < end) {
|
|
129763
129792
|
classifyDisabledCodeToken();
|
|
129764
129793
|
}
|
|
129765
129794
|
}
|
|
129766
129795
|
function classifyDisabledCodeToken() {
|
|
129767
|
-
const start = mergeConflictScanner.
|
|
129796
|
+
const start = mergeConflictScanner.getTokenEnd();
|
|
129768
129797
|
const tokenKind = mergeConflictScanner.scan();
|
|
129769
|
-
const end = mergeConflictScanner.
|
|
129798
|
+
const end = mergeConflictScanner.getTokenEnd();
|
|
129770
129799
|
const type = classifyTokenType(tokenKind);
|
|
129771
129800
|
if (type) {
|
|
129772
129801
|
pushClassification(start, end - start, type);
|
|
@@ -131165,7 +131194,7 @@ ${lanes.join("\n")}
|
|
|
131165
131194
|
}
|
|
131166
131195
|
function getFileReference() {
|
|
131167
131196
|
const fileName = scanner.getTokenValue();
|
|
131168
|
-
const pos = scanner.
|
|
131197
|
+
const pos = scanner.getTokenStart();
|
|
131169
131198
|
return { fileName, pos, end: pos + fileName.length };
|
|
131170
131199
|
}
|
|
131171
131200
|
function recordAmbientExternalModule() {
|
|
@@ -132882,10 +132911,10 @@ ${lanes.join("\n")}
|
|
|
132882
132911
|
return children;
|
|
132883
132912
|
}
|
|
132884
132913
|
function addSyntheticNodes(nodes, pos, end, parent2) {
|
|
132885
|
-
scanner.
|
|
132914
|
+
scanner.resetTokenState(pos);
|
|
132886
132915
|
while (pos < end) {
|
|
132887
132916
|
const token = scanner.scan();
|
|
132888
|
-
const textPos = scanner.
|
|
132917
|
+
const textPos = scanner.getTokenEnd();
|
|
132889
132918
|
if (textPos <= end) {
|
|
132890
132919
|
if (token === 79 /* Identifier */) {
|
|
132891
132920
|
if (hasTabstop(parent2)) {
|
|
@@ -143873,6 +143902,24 @@ ${lanes.join("\n")}
|
|
|
143873
143902
|
function deleteDestructuringElements(changes, sourceFile, node) {
|
|
143874
143903
|
forEach(node.elements, (n) => changes.delete(sourceFile, n));
|
|
143875
143904
|
}
|
|
143905
|
+
function deleteDestructuring(context, changes, sourceFile, { parent: parent2 }) {
|
|
143906
|
+
if (isVariableDeclaration(parent2) && parent2.initializer && isCallLikeExpression(parent2.initializer)) {
|
|
143907
|
+
if (isVariableDeclarationList(parent2.parent) && length(parent2.parent.declarations) > 1) {
|
|
143908
|
+
const varStatement = parent2.parent.parent;
|
|
143909
|
+
const pos = varStatement.getStart(sourceFile);
|
|
143910
|
+
const end = varStatement.end;
|
|
143911
|
+
changes.delete(sourceFile, parent2);
|
|
143912
|
+
changes.insertNodeAt(sourceFile, end, parent2.initializer, {
|
|
143913
|
+
prefix: getNewLineOrDefaultFromHost(context.host, context.formatContext.options) + sourceFile.text.slice(getPrecedingNonSpaceCharacterPosition(sourceFile.text, pos - 1), pos),
|
|
143914
|
+
suffix: probablyUsesSemicolons(sourceFile) ? ";" : ""
|
|
143915
|
+
});
|
|
143916
|
+
} else {
|
|
143917
|
+
changes.replaceNode(sourceFile, parent2.parent, parent2.initializer);
|
|
143918
|
+
}
|
|
143919
|
+
} else {
|
|
143920
|
+
changes.delete(sourceFile, parent2);
|
|
143921
|
+
}
|
|
143922
|
+
}
|
|
143876
143923
|
function tryPrefixDeclaration(changes, errorCode, sourceFile, token) {
|
|
143877
143924
|
if (errorCode === Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code)
|
|
143878
143925
|
return;
|
|
@@ -144062,7 +144109,7 @@ ${lanes.join("\n")}
|
|
|
144062
144109
|
];
|
|
144063
144110
|
}
|
|
144064
144111
|
return [
|
|
144065
|
-
createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t) => t
|
|
144112
|
+
createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t) => deleteDestructuring(context, t, sourceFile, token.parent)), Diagnostics.Remove_unused_destructuring_declaration)
|
|
144066
144113
|
];
|
|
144067
144114
|
}
|
|
144068
144115
|
if (canDeleteEntireVariableStatement(sourceFile, token)) {
|
|
@@ -149453,7 +149500,7 @@ ${lanes.join("\n")}
|
|
|
149453
149500
|
function getTypeScriptMemberSymbols() {
|
|
149454
149501
|
completionKind = 2 /* PropertyAccess */;
|
|
149455
149502
|
const isImportType = isLiteralImportTypeNode(node);
|
|
149456
|
-
const isTypeLocation =
|
|
149503
|
+
const isTypeLocation = isImportType && !node.isTypeOf || isPartOfTypeNode(node.parent) || isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker);
|
|
149457
149504
|
const isRhsOfImportDeclaration = isInRightSideOfInternalImportEqualsDeclaration(node);
|
|
149458
149505
|
if (isEntityName(node) || isImportType || isPropertyAccessExpression(node)) {
|
|
149459
149506
|
const isNamespaceName = isModuleDeclaration(node.parent);
|
|
@@ -149473,13 +149520,13 @@ ${lanes.join("\n")}
|
|
|
149473
149520
|
} : isRhsOfImportDeclaration ? (
|
|
149474
149521
|
// Any kind is allowed when dotting off namespace in internal import equals declaration
|
|
149475
149522
|
(symbol2) => isValidTypeAccess(symbol2) || isValidValueAccess(symbol2)
|
|
149476
|
-
) : isTypeLocation ? isValidTypeAccess : isValidValueAccess;
|
|
149523
|
+
) : isTypeLocation || insideJsDocTagTypeExpression ? isValidTypeAccess : isValidValueAccess;
|
|
149477
149524
|
for (const exportedSymbol of exportedSymbols) {
|
|
149478
149525
|
if (isValidAccess(exportedSymbol)) {
|
|
149479
149526
|
symbols.push(exportedSymbol);
|
|
149480
149527
|
}
|
|
149481
149528
|
}
|
|
149482
|
-
if (!isTypeLocation && symbol.declarations && symbol.declarations.some((d) => d.kind !== 308 /* SourceFile */ && d.kind !== 264 /* ModuleDeclaration */ && d.kind !== 263 /* EnumDeclaration */)) {
|
|
149529
|
+
if (!isTypeLocation && !insideJsDocTagTypeExpression && symbol.declarations && symbol.declarations.some((d) => d.kind !== 308 /* SourceFile */ && d.kind !== 264 /* ModuleDeclaration */ && d.kind !== 263 /* EnumDeclaration */)) {
|
|
149483
149530
|
let type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType();
|
|
149484
149531
|
let insertQuestionDot = false;
|
|
149485
149532
|
if (type.isNullableType()) {
|
|
@@ -155744,7 +155791,7 @@ ${lanes.join("\n")}
|
|
|
155744
155791
|
const endPos = decl.getStart();
|
|
155745
155792
|
scanner2.setText(sourceFile.text, startPos, endPos - startPos);
|
|
155746
155793
|
let numberOfNewLines = 0;
|
|
155747
|
-
while (scanner2.
|
|
155794
|
+
while (scanner2.getTokenStart() < endPos) {
|
|
155748
155795
|
const tokenKind = scanner2.scan();
|
|
155749
155796
|
if (tokenKind === 4 /* NewLineTrivia */) {
|
|
155750
155797
|
numberOfNewLines++;
|
|
@@ -157606,7 +157653,7 @@ ${lanes.join("\n")}
|
|
|
157606
157653
|
}
|
|
157607
157654
|
deleteUnusedOldImports(oldFile, toMove.all, changes, usage.unusedImportsFromOldFile, checker);
|
|
157608
157655
|
deleteMovedStatements(oldFile, toMove.ranges, changes);
|
|
157609
|
-
updateImportsInOtherFiles(changes, program, host, oldFile, usage.movedSymbols, newFilename);
|
|
157656
|
+
updateImportsInOtherFiles(changes, program, host, oldFile, usage.movedSymbols, newFilename, quotePreference);
|
|
157610
157657
|
const imports = getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, program, host, useEsModuleSyntax, quotePreference);
|
|
157611
157658
|
const body = addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEsModuleSyntax);
|
|
157612
157659
|
if (imports.length && body.length) {
|
|
@@ -157635,7 +157682,7 @@ ${lanes.join("\n")}
|
|
|
157635
157682
|
forEachImportInStatement(statement, (i) => deleteUnusedImports(oldFile, i, changes, (name) => toDelete.has(checker.getSymbolAtLocation(name))));
|
|
157636
157683
|
}
|
|
157637
157684
|
}
|
|
157638
|
-
function updateImportsInOtherFiles(changes, program, host, oldFile, movedSymbols, newFilename) {
|
|
157685
|
+
function updateImportsInOtherFiles(changes, program, host, oldFile, movedSymbols, newFilename, quotePreference) {
|
|
157639
157686
|
const checker = program.getTypeChecker();
|
|
157640
157687
|
for (const sourceFile of program.getSourceFiles()) {
|
|
157641
157688
|
if (sourceFile === oldFile)
|
|
@@ -157651,12 +157698,12 @@ ${lanes.join("\n")}
|
|
|
157651
157698
|
deleteUnusedImports(sourceFile, importNode, changes, shouldMove);
|
|
157652
157699
|
const pathToNewFileWithExtension = resolvePath(getDirectoryPath(oldFile.path), newFilename);
|
|
157653
157700
|
const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.path, pathToNewFileWithExtension, createModuleSpecifierResolutionHost(program, host));
|
|
157654
|
-
const newImportDeclaration = filterImport(importNode,
|
|
157701
|
+
const newImportDeclaration = filterImport(importNode, makeStringLiteral(newModuleSpecifier, quotePreference), shouldMove);
|
|
157655
157702
|
if (newImportDeclaration)
|
|
157656
157703
|
changes.insertNodeAfter(sourceFile, statement, newImportDeclaration);
|
|
157657
157704
|
const ns = getNamespaceLikeImport(importNode);
|
|
157658
157705
|
if (ns)
|
|
157659
|
-
updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleSpecifier, ns, importNode);
|
|
157706
|
+
updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleSpecifier, ns, importNode, quotePreference);
|
|
157660
157707
|
});
|
|
157661
157708
|
}
|
|
157662
157709
|
}
|
|
@@ -157673,7 +157720,7 @@ ${lanes.join("\n")}
|
|
|
157673
157720
|
return Debug.assertNever(node, `Unexpected node kind ${node.kind}`);
|
|
157674
157721
|
}
|
|
157675
157722
|
}
|
|
157676
|
-
function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleSpecifier, oldImportId, oldImportNode) {
|
|
157723
|
+
function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleSpecifier, oldImportId, oldImportNode, quotePreference) {
|
|
157677
157724
|
const preferredNewNamespaceName = ts_codefix_exports.moduleSpecifierToValidIdentifier(newModuleSpecifier, 99 /* ESNext */);
|
|
157678
157725
|
let needUniqueName = false;
|
|
157679
157726
|
const toChange = [];
|
|
@@ -157696,12 +157743,12 @@ ${lanes.join("\n")}
|
|
|
157696
157743
|
for (const ref of toChange) {
|
|
157697
157744
|
changes.replaceNode(sourceFile, ref, factory.createIdentifier(newNamespaceName));
|
|
157698
157745
|
}
|
|
157699
|
-
changes.insertNodeAfter(sourceFile, oldImportNode, updateNamespaceLikeImportNode(oldImportNode, preferredNewNamespaceName, newModuleSpecifier));
|
|
157746
|
+
changes.insertNodeAfter(sourceFile, oldImportNode, updateNamespaceLikeImportNode(oldImportNode, preferredNewNamespaceName, newModuleSpecifier, quotePreference));
|
|
157700
157747
|
}
|
|
157701
157748
|
}
|
|
157702
|
-
function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifier) {
|
|
157749
|
+
function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifier, quotePreference) {
|
|
157703
157750
|
const newNamespaceId = factory.createIdentifier(newNamespaceName);
|
|
157704
|
-
const newModuleString =
|
|
157751
|
+
const newModuleString = makeStringLiteral(newModuleSpecifier, quotePreference);
|
|
157705
157752
|
switch (node.kind) {
|
|
157706
157753
|
case 269 /* ImportDeclaration */:
|
|
157707
157754
|
return factory.createImportDeclaration(
|
|
@@ -157800,7 +157847,7 @@ ${lanes.join("\n")}
|
|
|
157800
157847
|
factory.createObjectBindingPattern(bindingElements),
|
|
157801
157848
|
/*type*/
|
|
157802
157849
|
void 0,
|
|
157803
|
-
createRequireCall(
|
|
157850
|
+
createRequireCall(makeStringLiteral(pathToNewFileWithCorrectExtension, quotePreference))
|
|
157804
157851
|
) : void 0;
|
|
157805
157852
|
}
|
|
157806
157853
|
}
|
|
@@ -164814,7 +164861,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
164814
164861
|
function getFormattingScanner(text, languageVariant, startPos, endPos, cb) {
|
|
164815
164862
|
const scanner2 = languageVariant === 1 /* JSX */ ? jsxScanner : standardScanner;
|
|
164816
164863
|
scanner2.setText(text);
|
|
164817
|
-
scanner2.
|
|
164864
|
+
scanner2.resetTokenState(startPos);
|
|
164818
164865
|
let wasNewLine = true;
|
|
164819
164866
|
let leadingTrivia;
|
|
164820
164867
|
let trailingTrivia;
|
|
@@ -164831,9 +164878,13 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
164831
164878
|
lastTrailingTriviaWasNewLine: () => wasNewLine,
|
|
164832
164879
|
skipToEndOf,
|
|
164833
164880
|
skipToStartOf,
|
|
164881
|
+
getTokenFullStart: () => {
|
|
164882
|
+
var _a2;
|
|
164883
|
+
return (_a2 = lastTokenInfo == null ? void 0 : lastTokenInfo.token.pos) != null ? _a2 : scanner2.getTokenStart();
|
|
164884
|
+
},
|
|
164834
164885
|
getStartPos: () => {
|
|
164835
164886
|
var _a2;
|
|
164836
|
-
return (_a2 = lastTokenInfo == null ? void 0 : lastTokenInfo.token.pos) != null ? _a2 : scanner2.
|
|
164887
|
+
return (_a2 = lastTokenInfo == null ? void 0 : lastTokenInfo.token.pos) != null ? _a2 : scanner2.getTokenStart();
|
|
164837
164888
|
}
|
|
164838
164889
|
});
|
|
164839
164890
|
lastTokenInfo = void 0;
|
|
@@ -164841,7 +164892,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
164841
164892
|
return res;
|
|
164842
164893
|
function advance() {
|
|
164843
164894
|
lastTokenInfo = void 0;
|
|
164844
|
-
const isStarted = scanner2.
|
|
164895
|
+
const isStarted = scanner2.getTokenFullStart() !== startPos;
|
|
164845
164896
|
if (isStarted) {
|
|
164846
164897
|
wasNewLine = !!trailingTrivia && last(trailingTrivia).kind === 4 /* NewLineTrivia */;
|
|
164847
164898
|
} else {
|
|
@@ -164849,7 +164900,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
164849
164900
|
}
|
|
164850
164901
|
leadingTrivia = void 0;
|
|
164851
164902
|
trailingTrivia = void 0;
|
|
164852
|
-
let pos = scanner2.
|
|
164903
|
+
let pos = scanner2.getTokenFullStart();
|
|
164853
164904
|
while (pos < endPos) {
|
|
164854
164905
|
const t = scanner2.getToken();
|
|
164855
164906
|
if (!isTrivia(t)) {
|
|
@@ -164858,13 +164909,13 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
164858
164909
|
scanner2.scan();
|
|
164859
164910
|
const item = {
|
|
164860
164911
|
pos,
|
|
164861
|
-
end: scanner2.
|
|
164912
|
+
end: scanner2.getTokenFullStart(),
|
|
164862
164913
|
kind: t
|
|
164863
164914
|
};
|
|
164864
|
-
pos = scanner2.
|
|
164915
|
+
pos = scanner2.getTokenFullStart();
|
|
164865
164916
|
leadingTrivia = append(leadingTrivia, item);
|
|
164866
164917
|
}
|
|
164867
|
-
savedPos = scanner2.
|
|
164918
|
+
savedPos = scanner2.getTokenFullStart();
|
|
164868
164919
|
}
|
|
164869
164920
|
function shouldRescanGreaterThanToken(node) {
|
|
164870
164921
|
switch (node.kind) {
|
|
@@ -164910,28 +164961,28 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
164910
164961
|
if (lastTokenInfo && expectedScanAction === lastScanAction) {
|
|
164911
164962
|
return fixTokenKind(lastTokenInfo, n);
|
|
164912
164963
|
}
|
|
164913
|
-
if (scanner2.
|
|
164964
|
+
if (scanner2.getTokenFullStart() !== savedPos) {
|
|
164914
164965
|
Debug.assert(lastTokenInfo !== void 0);
|
|
164915
|
-
scanner2.
|
|
164966
|
+
scanner2.resetTokenState(savedPos);
|
|
164916
164967
|
scanner2.scan();
|
|
164917
164968
|
}
|
|
164918
164969
|
let currentToken = getNextToken(n, expectedScanAction);
|
|
164919
164970
|
const token = createTextRangeWithKind(
|
|
164920
|
-
scanner2.
|
|
164921
|
-
scanner2.
|
|
164971
|
+
scanner2.getTokenFullStart(),
|
|
164972
|
+
scanner2.getTokenEnd(),
|
|
164922
164973
|
currentToken
|
|
164923
164974
|
);
|
|
164924
164975
|
if (trailingTrivia) {
|
|
164925
164976
|
trailingTrivia = void 0;
|
|
164926
164977
|
}
|
|
164927
|
-
while (scanner2.
|
|
164978
|
+
while (scanner2.getTokenFullStart() < endPos) {
|
|
164928
164979
|
currentToken = scanner2.scan();
|
|
164929
164980
|
if (!isTrivia(currentToken)) {
|
|
164930
164981
|
break;
|
|
164931
164982
|
}
|
|
164932
164983
|
const trivia = createTextRangeWithKind(
|
|
164933
|
-
scanner2.
|
|
164934
|
-
scanner2.
|
|
164984
|
+
scanner2.getTokenFullStart(),
|
|
164985
|
+
scanner2.getTokenEnd(),
|
|
164935
164986
|
currentToken
|
|
164936
164987
|
);
|
|
164937
164988
|
if (!trailingTrivia) {
|
|
@@ -164996,7 +165047,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
164996
165047
|
}
|
|
164997
165048
|
function readEOFTokenRange() {
|
|
164998
165049
|
Debug.assert(isOnEOF());
|
|
164999
|
-
return createTextRangeWithKind(scanner2.
|
|
165050
|
+
return createTextRangeWithKind(scanner2.getTokenFullStart(), scanner2.getTokenEnd(), 1 /* EndOfFileToken */);
|
|
165000
165051
|
}
|
|
165001
165052
|
function isOnToken() {
|
|
165002
165053
|
const current = lastTokenInfo ? lastTokenInfo.token.kind : scanner2.getToken();
|
|
@@ -165013,8 +165064,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
165013
165064
|
return tokenInfo;
|
|
165014
165065
|
}
|
|
165015
165066
|
function skipToEndOf(node) {
|
|
165016
|
-
scanner2.
|
|
165017
|
-
savedPos = scanner2.
|
|
165067
|
+
scanner2.resetTokenState(node.end);
|
|
165068
|
+
savedPos = scanner2.getTokenFullStart();
|
|
165018
165069
|
lastScanAction = void 0;
|
|
165019
165070
|
lastTokenInfo = void 0;
|
|
165020
165071
|
wasNewLine = false;
|
|
@@ -165022,8 +165073,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
165022
165073
|
trailingTrivia = void 0;
|
|
165023
165074
|
}
|
|
165024
165075
|
function skipToStartOf(node) {
|
|
165025
|
-
scanner2.
|
|
165026
|
-
savedPos = scanner2.
|
|
165076
|
+
scanner2.resetTokenState(node.pos);
|
|
165077
|
+
savedPos = scanner2.getTokenFullStart();
|
|
165027
165078
|
lastScanAction = void 0;
|
|
165028
165079
|
lastTokenInfo = void 0;
|
|
165029
165080
|
wasNewLine = false;
|
|
@@ -166139,7 +166190,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
166139
166190
|
}
|
|
166140
166191
|
}
|
|
166141
166192
|
}
|
|
166142
|
-
if (previousRange && formattingScanner.
|
|
166193
|
+
if (previousRange && formattingScanner.getTokenFullStart() >= originalRange.end) {
|
|
166143
166194
|
const tokenInfo = formattingScanner.isOnEOF() ? formattingScanner.readEOFTokenRange() : formattingScanner.isOnToken() ? formattingScanner.readTokenInfo(enclosingNode).token : void 0;
|
|
166144
166195
|
if (tokenInfo && tokenInfo.pos === previousRangeTriviaEnd) {
|
|
166145
166196
|
const parent2 = ((_a2 = findPrecedingToken(tokenInfo.end, sourceFile, enclosingNode)) == null ? void 0 : _a2.parent) || previousParent;
|
|
@@ -166317,7 +166368,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
166317
166368
|
processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation);
|
|
166318
166369
|
}
|
|
166319
166370
|
);
|
|
166320
|
-
while (formattingScanner.isOnToken() && formattingScanner.
|
|
166371
|
+
while (formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) {
|
|
166321
166372
|
const tokenInfo = formattingScanner.readTokenInfo(node);
|
|
166322
166373
|
if (tokenInfo.token.end > Math.min(node.end, originalRange.end)) {
|
|
166323
166374
|
break;
|
|
@@ -166351,7 +166402,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
166351
166402
|
if (child.getFullWidth() === 0) {
|
|
166352
166403
|
return inheritedIndentation;
|
|
166353
166404
|
}
|
|
166354
|
-
while (formattingScanner.isOnToken() && formattingScanner.
|
|
166405
|
+
while (formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) {
|
|
166355
166406
|
const tokenInfo = formattingScanner.readTokenInfo(node);
|
|
166356
166407
|
if (tokenInfo.token.end > originalRange.end) {
|
|
166357
166408
|
return inheritedIndentation;
|
|
@@ -166364,7 +166415,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
166364
166415
|
}
|
|
166365
166416
|
consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, node);
|
|
166366
166417
|
}
|
|
166367
|
-
if (!formattingScanner.isOnToken() || formattingScanner.
|
|
166418
|
+
if (!formattingScanner.isOnToken() || formattingScanner.getTokenFullStart() >= originalRange.end) {
|
|
166368
166419
|
return inheritedIndentation;
|
|
166369
166420
|
}
|
|
166370
166421
|
if (isToken(child)) {
|
|
@@ -166397,7 +166448,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
166397
166448
|
return;
|
|
166398
166449
|
}
|
|
166399
166450
|
if (listStartToken !== 0 /* Unknown */) {
|
|
166400
|
-
while (formattingScanner.isOnToken() && formattingScanner.
|
|
166451
|
+
while (formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) {
|
|
166401
166452
|
const tokenInfo = formattingScanner.readTokenInfo(parent2);
|
|
166402
166453
|
if (tokenInfo.token.end > nodes.pos) {
|
|
166403
166454
|
break;
|
|
@@ -166434,7 +166485,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
166434
166485
|
);
|
|
166435
166486
|
}
|
|
166436
166487
|
const listEndToken = getCloseTokenForOpenToken(listStartToken);
|
|
166437
|
-
if (listEndToken !== 0 /* Unknown */ && formattingScanner.isOnToken() && formattingScanner.
|
|
166488
|
+
if (listEndToken !== 0 /* Unknown */ && formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) {
|
|
166438
166489
|
let tokenInfo = formattingScanner.readTokenInfo(parent2);
|
|
166439
166490
|
if (tokenInfo.token.kind === 27 /* CommaToken */) {
|
|
166440
166491
|
consumeTokenAndAdvanceScanner(tokenInfo, parent2, listDynamicIndentation, parent2);
|
|
@@ -178559,7 +178610,6 @@ ${e.message}`;
|
|
|
178559
178610
|
ContextFlags: () => ContextFlags,
|
|
178560
178611
|
CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter,
|
|
178561
178612
|
Debug: () => Debug,
|
|
178562
|
-
DeprecationVersion: () => DeprecationVersion,
|
|
178563
178613
|
DiagnosticCategory: () => DiagnosticCategory,
|
|
178564
178614
|
Diagnostics: () => Diagnostics,
|
|
178565
178615
|
DocumentHighlights: () => DocumentHighlights,
|
|
@@ -180917,7 +180967,6 @@ ${e.message}`;
|
|
|
180917
180967
|
ContextFlags: () => ContextFlags,
|
|
180918
180968
|
CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter,
|
|
180919
180969
|
Debug: () => Debug,
|
|
180920
|
-
DeprecationVersion: () => DeprecationVersion,
|
|
180921
180970
|
DiagnosticCategory: () => DiagnosticCategory,
|
|
180922
180971
|
Diagnostics: () => Diagnostics,
|
|
180923
180972
|
DocumentHighlights: () => DocumentHighlights,
|