@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/typescript.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__ */ ((ModuleResolutionKind2) => {
|
|
4648
4648
|
ModuleResolutionKind2[ModuleResolutionKind2["Classic"] = 1] = "Classic";
|
|
4649
|
+
ModuleResolutionKind2[ModuleResolutionKind2["NodeJs"] = 2] = "NodeJs";
|
|
4649
4650
|
ModuleResolutionKind2[ModuleResolutionKind2["Node10"] = 2] = "Node10";
|
|
4650
4651
|
ModuleResolutionKind2[ModuleResolutionKind2["Node16"] = 3] = "Node16";
|
|
4651
4652
|
ModuleResolutionKind2[ModuleResolutionKind2["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, indent2, 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(), indent2, indentText)), start2);
|
|
34594
34603
|
}
|
|
34595
34604
|
function parseTypeTag(start2, tagName, indent2, 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, indent2, 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, indent2, 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, indent2) {
|
|
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;
|
|
@@ -127150,12 +127176,15 @@ ${lanes.join("\n")}
|
|
|
127150
127176
|
}
|
|
127151
127177
|
return false;
|
|
127152
127178
|
}
|
|
127179
|
+
function areIntersectedTypesAvoidingStringReduction(checker, t1, t2) {
|
|
127180
|
+
return !!(t1.flags & 4 /* String */) && checker.isEmptyAnonymousObjectType(t2);
|
|
127181
|
+
}
|
|
127153
127182
|
function isStringAndEmptyAnonymousObjectIntersection(type) {
|
|
127154
127183
|
if (!type.isIntersection()) {
|
|
127155
127184
|
return false;
|
|
127156
127185
|
}
|
|
127157
127186
|
const { types, checker } = type;
|
|
127158
|
-
return types.length === 2 && types[0]
|
|
127187
|
+
return types.length === 2 && (areIntersectedTypesAvoidingStringReduction(checker, types[0], types[1]) || areIntersectedTypesAvoidingStringReduction(checker, types[1], types[0]));
|
|
127159
127188
|
}
|
|
127160
127189
|
function isPunctuation(kind) {
|
|
127161
127190
|
return 18 /* FirstPunctuation */ <= kind && kind <= 78 /* LastPunctuation */;
|
|
@@ -129088,8 +129117,8 @@ ${lanes.join("\n")}
|
|
|
129088
129117
|
handleToken();
|
|
129089
129118
|
lastNonTriviaToken = token;
|
|
129090
129119
|
}
|
|
129091
|
-
const end = scanner2.
|
|
129092
|
-
pushEncodedClassification(scanner2.
|
|
129120
|
+
const end = scanner2.getTokenEnd();
|
|
129121
|
+
pushEncodedClassification(scanner2.getTokenStart(), end, offset, classFromKind(token), spans);
|
|
129093
129122
|
if (end >= text.length) {
|
|
129094
129123
|
const end2 = getNewEndOfLineState(scanner2, token, lastOrUndefined(templateStack));
|
|
129095
129124
|
if (end2 !== void 0) {
|
|
@@ -129554,14 +129583,14 @@ ${lanes.join("\n")}
|
|
|
129554
129583
|
result.push(type);
|
|
129555
129584
|
}
|
|
129556
129585
|
function classifyLeadingTriviaAndGetTokenStart(token) {
|
|
129557
|
-
triviaScanner.
|
|
129586
|
+
triviaScanner.resetTokenState(token.pos);
|
|
129558
129587
|
while (true) {
|
|
129559
|
-
const start = triviaScanner.
|
|
129588
|
+
const start = triviaScanner.getTokenEnd();
|
|
129560
129589
|
if (!couldStartTrivia(sourceFile.text, start)) {
|
|
129561
129590
|
return start;
|
|
129562
129591
|
}
|
|
129563
129592
|
const kind = triviaScanner.scan();
|
|
129564
|
-
const end = triviaScanner.
|
|
129593
|
+
const end = triviaScanner.getTokenEnd();
|
|
129565
129594
|
const width = end - start;
|
|
129566
129595
|
if (!isTrivia(kind)) {
|
|
129567
129596
|
return start;
|
|
@@ -129573,7 +129602,7 @@ ${lanes.join("\n")}
|
|
|
129573
129602
|
case 2 /* SingleLineCommentTrivia */:
|
|
129574
129603
|
case 3 /* MultiLineCommentTrivia */:
|
|
129575
129604
|
classifyComment(token, kind, start, width);
|
|
129576
|
-
triviaScanner.
|
|
129605
|
+
triviaScanner.resetTokenState(end);
|
|
129577
129606
|
continue;
|
|
129578
129607
|
case 7 /* ConflictMarkerTrivia */:
|
|
129579
129608
|
const text = sourceFile.text;
|
|
@@ -129772,15 +129801,15 @@ ${lanes.join("\n")}
|
|
|
129772
129801
|
}
|
|
129773
129802
|
}
|
|
129774
129803
|
pushClassification(start, i - start, 1 /* comment */);
|
|
129775
|
-
mergeConflictScanner.
|
|
129776
|
-
while (mergeConflictScanner.
|
|
129804
|
+
mergeConflictScanner.resetTokenState(i);
|
|
129805
|
+
while (mergeConflictScanner.getTokenEnd() < end) {
|
|
129777
129806
|
classifyDisabledCodeToken();
|
|
129778
129807
|
}
|
|
129779
129808
|
}
|
|
129780
129809
|
function classifyDisabledCodeToken() {
|
|
129781
|
-
const start = mergeConflictScanner.
|
|
129810
|
+
const start = mergeConflictScanner.getTokenEnd();
|
|
129782
129811
|
const tokenKind = mergeConflictScanner.scan();
|
|
129783
|
-
const end = mergeConflictScanner.
|
|
129812
|
+
const end = mergeConflictScanner.getTokenEnd();
|
|
129784
129813
|
const type = classifyTokenType(tokenKind);
|
|
129785
129814
|
if (type) {
|
|
129786
129815
|
pushClassification(start, end - start, type);
|
|
@@ -131179,7 +131208,7 @@ ${lanes.join("\n")}
|
|
|
131179
131208
|
}
|
|
131180
131209
|
function getFileReference() {
|
|
131181
131210
|
const fileName = scanner.getTokenValue();
|
|
131182
|
-
const pos = scanner.
|
|
131211
|
+
const pos = scanner.getTokenStart();
|
|
131183
131212
|
return { fileName, pos, end: pos + fileName.length };
|
|
131184
131213
|
}
|
|
131185
131214
|
function recordAmbientExternalModule() {
|
|
@@ -132896,10 +132925,10 @@ ${lanes.join("\n")}
|
|
|
132896
132925
|
return children;
|
|
132897
132926
|
}
|
|
132898
132927
|
function addSyntheticNodes(nodes, pos, end, parent2) {
|
|
132899
|
-
scanner.
|
|
132928
|
+
scanner.resetTokenState(pos);
|
|
132900
132929
|
while (pos < end) {
|
|
132901
132930
|
const token = scanner.scan();
|
|
132902
|
-
const textPos = scanner.
|
|
132931
|
+
const textPos = scanner.getTokenEnd();
|
|
132903
132932
|
if (textPos <= end) {
|
|
132904
132933
|
if (token === 79 /* Identifier */) {
|
|
132905
132934
|
if (hasTabstop(parent2)) {
|
|
@@ -143887,6 +143916,24 @@ ${lanes.join("\n")}
|
|
|
143887
143916
|
function deleteDestructuringElements(changes, sourceFile, node) {
|
|
143888
143917
|
forEach(node.elements, (n) => changes.delete(sourceFile, n));
|
|
143889
143918
|
}
|
|
143919
|
+
function deleteDestructuring(context, changes, sourceFile, { parent: parent2 }) {
|
|
143920
|
+
if (isVariableDeclaration(parent2) && parent2.initializer && isCallLikeExpression(parent2.initializer)) {
|
|
143921
|
+
if (isVariableDeclarationList(parent2.parent) && length(parent2.parent.declarations) > 1) {
|
|
143922
|
+
const varStatement = parent2.parent.parent;
|
|
143923
|
+
const pos = varStatement.getStart(sourceFile);
|
|
143924
|
+
const end = varStatement.end;
|
|
143925
|
+
changes.delete(sourceFile, parent2);
|
|
143926
|
+
changes.insertNodeAt(sourceFile, end, parent2.initializer, {
|
|
143927
|
+
prefix: getNewLineOrDefaultFromHost(context.host, context.formatContext.options) + sourceFile.text.slice(getPrecedingNonSpaceCharacterPosition(sourceFile.text, pos - 1), pos),
|
|
143928
|
+
suffix: probablyUsesSemicolons(sourceFile) ? ";" : ""
|
|
143929
|
+
});
|
|
143930
|
+
} else {
|
|
143931
|
+
changes.replaceNode(sourceFile, parent2.parent, parent2.initializer);
|
|
143932
|
+
}
|
|
143933
|
+
} else {
|
|
143934
|
+
changes.delete(sourceFile, parent2);
|
|
143935
|
+
}
|
|
143936
|
+
}
|
|
143890
143937
|
function tryPrefixDeclaration(changes, errorCode, sourceFile, token) {
|
|
143891
143938
|
if (errorCode === Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code)
|
|
143892
143939
|
return;
|
|
@@ -144076,7 +144123,7 @@ ${lanes.join("\n")}
|
|
|
144076
144123
|
];
|
|
144077
144124
|
}
|
|
144078
144125
|
return [
|
|
144079
|
-
createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t) => t
|
|
144126
|
+
createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context, (t) => deleteDestructuring(context, t, sourceFile, token.parent)), Diagnostics.Remove_unused_destructuring_declaration)
|
|
144080
144127
|
];
|
|
144081
144128
|
}
|
|
144082
144129
|
if (canDeleteEntireVariableStatement(sourceFile, token)) {
|
|
@@ -149467,7 +149514,7 @@ ${lanes.join("\n")}
|
|
|
149467
149514
|
function getTypeScriptMemberSymbols() {
|
|
149468
149515
|
completionKind = 2 /* PropertyAccess */;
|
|
149469
149516
|
const isImportType = isLiteralImportTypeNode(node);
|
|
149470
|
-
const isTypeLocation =
|
|
149517
|
+
const isTypeLocation = isImportType && !node.isTypeOf || isPartOfTypeNode(node.parent) || isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker);
|
|
149471
149518
|
const isRhsOfImportDeclaration = isInRightSideOfInternalImportEqualsDeclaration(node);
|
|
149472
149519
|
if (isEntityName(node) || isImportType || isPropertyAccessExpression(node)) {
|
|
149473
149520
|
const isNamespaceName = isModuleDeclaration(node.parent);
|
|
@@ -149487,13 +149534,13 @@ ${lanes.join("\n")}
|
|
|
149487
149534
|
} : isRhsOfImportDeclaration ? (
|
|
149488
149535
|
// Any kind is allowed when dotting off namespace in internal import equals declaration
|
|
149489
149536
|
(symbol2) => isValidTypeAccess(symbol2) || isValidValueAccess(symbol2)
|
|
149490
|
-
) : isTypeLocation ? isValidTypeAccess : isValidValueAccess;
|
|
149537
|
+
) : isTypeLocation || insideJsDocTagTypeExpression ? isValidTypeAccess : isValidValueAccess;
|
|
149491
149538
|
for (const exportedSymbol of exportedSymbols) {
|
|
149492
149539
|
if (isValidAccess(exportedSymbol)) {
|
|
149493
149540
|
symbols.push(exportedSymbol);
|
|
149494
149541
|
}
|
|
149495
149542
|
}
|
|
149496
|
-
if (!isTypeLocation && symbol.declarations && symbol.declarations.some((d) => d.kind !== 308 /* SourceFile */ && d.kind !== 264 /* ModuleDeclaration */ && d.kind !== 263 /* EnumDeclaration */)) {
|
|
149543
|
+
if (!isTypeLocation && !insideJsDocTagTypeExpression && symbol.declarations && symbol.declarations.some((d) => d.kind !== 308 /* SourceFile */ && d.kind !== 264 /* ModuleDeclaration */ && d.kind !== 263 /* EnumDeclaration */)) {
|
|
149497
149544
|
let type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType();
|
|
149498
149545
|
let insertQuestionDot = false;
|
|
149499
149546
|
if (type.isNullableType()) {
|
|
@@ -155758,7 +155805,7 @@ ${lanes.join("\n")}
|
|
|
155758
155805
|
const endPos = decl.getStart();
|
|
155759
155806
|
scanner2.setText(sourceFile.text, startPos, endPos - startPos);
|
|
155760
155807
|
let numberOfNewLines = 0;
|
|
155761
|
-
while (scanner2.
|
|
155808
|
+
while (scanner2.getTokenStart() < endPos) {
|
|
155762
155809
|
const tokenKind = scanner2.scan();
|
|
155763
155810
|
if (tokenKind === 4 /* NewLineTrivia */) {
|
|
155764
155811
|
numberOfNewLines++;
|
|
@@ -157620,7 +157667,7 @@ ${lanes.join("\n")}
|
|
|
157620
157667
|
}
|
|
157621
157668
|
deleteUnusedOldImports(oldFile, toMove.all, changes, usage.unusedImportsFromOldFile, checker);
|
|
157622
157669
|
deleteMovedStatements(oldFile, toMove.ranges, changes);
|
|
157623
|
-
updateImportsInOtherFiles(changes, program, host, oldFile, usage.movedSymbols, newFilename);
|
|
157670
|
+
updateImportsInOtherFiles(changes, program, host, oldFile, usage.movedSymbols, newFilename, quotePreference);
|
|
157624
157671
|
const imports = getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, program, host, useEsModuleSyntax, quotePreference);
|
|
157625
157672
|
const body = addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEsModuleSyntax);
|
|
157626
157673
|
if (imports.length && body.length) {
|
|
@@ -157649,7 +157696,7 @@ ${lanes.join("\n")}
|
|
|
157649
157696
|
forEachImportInStatement(statement, (i) => deleteUnusedImports(oldFile, i, changes, (name) => toDelete.has(checker.getSymbolAtLocation(name))));
|
|
157650
157697
|
}
|
|
157651
157698
|
}
|
|
157652
|
-
function updateImportsInOtherFiles(changes, program, host, oldFile, movedSymbols, newFilename) {
|
|
157699
|
+
function updateImportsInOtherFiles(changes, program, host, oldFile, movedSymbols, newFilename, quotePreference) {
|
|
157653
157700
|
const checker = program.getTypeChecker();
|
|
157654
157701
|
for (const sourceFile of program.getSourceFiles()) {
|
|
157655
157702
|
if (sourceFile === oldFile)
|
|
@@ -157665,12 +157712,12 @@ ${lanes.join("\n")}
|
|
|
157665
157712
|
deleteUnusedImports(sourceFile, importNode, changes, shouldMove);
|
|
157666
157713
|
const pathToNewFileWithExtension = resolvePath(getDirectoryPath(oldFile.path), newFilename);
|
|
157667
157714
|
const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.path, pathToNewFileWithExtension, createModuleSpecifierResolutionHost(program, host));
|
|
157668
|
-
const newImportDeclaration = filterImport(importNode,
|
|
157715
|
+
const newImportDeclaration = filterImport(importNode, makeStringLiteral(newModuleSpecifier, quotePreference), shouldMove);
|
|
157669
157716
|
if (newImportDeclaration)
|
|
157670
157717
|
changes.insertNodeAfter(sourceFile, statement, newImportDeclaration);
|
|
157671
157718
|
const ns = getNamespaceLikeImport(importNode);
|
|
157672
157719
|
if (ns)
|
|
157673
|
-
updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleSpecifier, ns, importNode);
|
|
157720
|
+
updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleSpecifier, ns, importNode, quotePreference);
|
|
157674
157721
|
});
|
|
157675
157722
|
}
|
|
157676
157723
|
}
|
|
@@ -157687,7 +157734,7 @@ ${lanes.join("\n")}
|
|
|
157687
157734
|
return Debug.assertNever(node, `Unexpected node kind ${node.kind}`);
|
|
157688
157735
|
}
|
|
157689
157736
|
}
|
|
157690
|
-
function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleSpecifier, oldImportId, oldImportNode) {
|
|
157737
|
+
function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleSpecifier, oldImportId, oldImportNode, quotePreference) {
|
|
157691
157738
|
const preferredNewNamespaceName = ts_codefix_exports.moduleSpecifierToValidIdentifier(newModuleSpecifier, 99 /* ESNext */);
|
|
157692
157739
|
let needUniqueName = false;
|
|
157693
157740
|
const toChange = [];
|
|
@@ -157710,12 +157757,12 @@ ${lanes.join("\n")}
|
|
|
157710
157757
|
for (const ref of toChange) {
|
|
157711
157758
|
changes.replaceNode(sourceFile, ref, factory.createIdentifier(newNamespaceName));
|
|
157712
157759
|
}
|
|
157713
|
-
changes.insertNodeAfter(sourceFile, oldImportNode, updateNamespaceLikeImportNode(oldImportNode, preferredNewNamespaceName, newModuleSpecifier));
|
|
157760
|
+
changes.insertNodeAfter(sourceFile, oldImportNode, updateNamespaceLikeImportNode(oldImportNode, preferredNewNamespaceName, newModuleSpecifier, quotePreference));
|
|
157714
157761
|
}
|
|
157715
157762
|
}
|
|
157716
|
-
function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifier) {
|
|
157763
|
+
function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifier, quotePreference) {
|
|
157717
157764
|
const newNamespaceId = factory.createIdentifier(newNamespaceName);
|
|
157718
|
-
const newModuleString =
|
|
157765
|
+
const newModuleString = makeStringLiteral(newModuleSpecifier, quotePreference);
|
|
157719
157766
|
switch (node.kind) {
|
|
157720
157767
|
case 269 /* ImportDeclaration */:
|
|
157721
157768
|
return factory.createImportDeclaration(
|
|
@@ -157814,7 +157861,7 @@ ${lanes.join("\n")}
|
|
|
157814
157861
|
factory.createObjectBindingPattern(bindingElements),
|
|
157815
157862
|
/*type*/
|
|
157816
157863
|
void 0,
|
|
157817
|
-
createRequireCall(
|
|
157864
|
+
createRequireCall(makeStringLiteral(pathToNewFileWithCorrectExtension, quotePreference))
|
|
157818
157865
|
) : void 0;
|
|
157819
157866
|
}
|
|
157820
157867
|
}
|
|
@@ -164828,7 +164875,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
164828
164875
|
function getFormattingScanner(text, languageVariant, startPos, endPos, cb) {
|
|
164829
164876
|
const scanner2 = languageVariant === 1 /* JSX */ ? jsxScanner : standardScanner;
|
|
164830
164877
|
scanner2.setText(text);
|
|
164831
|
-
scanner2.
|
|
164878
|
+
scanner2.resetTokenState(startPos);
|
|
164832
164879
|
let wasNewLine = true;
|
|
164833
164880
|
let leadingTrivia;
|
|
164834
164881
|
let trailingTrivia;
|
|
@@ -164845,9 +164892,13 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
164845
164892
|
lastTrailingTriviaWasNewLine: () => wasNewLine,
|
|
164846
164893
|
skipToEndOf,
|
|
164847
164894
|
skipToStartOf,
|
|
164895
|
+
getTokenFullStart: () => {
|
|
164896
|
+
var _a2;
|
|
164897
|
+
return (_a2 = lastTokenInfo == null ? void 0 : lastTokenInfo.token.pos) != null ? _a2 : scanner2.getTokenStart();
|
|
164898
|
+
},
|
|
164848
164899
|
getStartPos: () => {
|
|
164849
164900
|
var _a2;
|
|
164850
|
-
return (_a2 = lastTokenInfo == null ? void 0 : lastTokenInfo.token.pos) != null ? _a2 : scanner2.
|
|
164901
|
+
return (_a2 = lastTokenInfo == null ? void 0 : lastTokenInfo.token.pos) != null ? _a2 : scanner2.getTokenStart();
|
|
164851
164902
|
}
|
|
164852
164903
|
});
|
|
164853
164904
|
lastTokenInfo = void 0;
|
|
@@ -164855,7 +164906,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
164855
164906
|
return res;
|
|
164856
164907
|
function advance() {
|
|
164857
164908
|
lastTokenInfo = void 0;
|
|
164858
|
-
const isStarted = scanner2.
|
|
164909
|
+
const isStarted = scanner2.getTokenFullStart() !== startPos;
|
|
164859
164910
|
if (isStarted) {
|
|
164860
164911
|
wasNewLine = !!trailingTrivia && last(trailingTrivia).kind === 4 /* NewLineTrivia */;
|
|
164861
164912
|
} else {
|
|
@@ -164863,7 +164914,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
164863
164914
|
}
|
|
164864
164915
|
leadingTrivia = void 0;
|
|
164865
164916
|
trailingTrivia = void 0;
|
|
164866
|
-
let pos = scanner2.
|
|
164917
|
+
let pos = scanner2.getTokenFullStart();
|
|
164867
164918
|
while (pos < endPos) {
|
|
164868
164919
|
const t = scanner2.getToken();
|
|
164869
164920
|
if (!isTrivia(t)) {
|
|
@@ -164872,13 +164923,13 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
164872
164923
|
scanner2.scan();
|
|
164873
164924
|
const item = {
|
|
164874
164925
|
pos,
|
|
164875
|
-
end: scanner2.
|
|
164926
|
+
end: scanner2.getTokenFullStart(),
|
|
164876
164927
|
kind: t
|
|
164877
164928
|
};
|
|
164878
|
-
pos = scanner2.
|
|
164929
|
+
pos = scanner2.getTokenFullStart();
|
|
164879
164930
|
leadingTrivia = append(leadingTrivia, item);
|
|
164880
164931
|
}
|
|
164881
|
-
savedPos = scanner2.
|
|
164932
|
+
savedPos = scanner2.getTokenFullStart();
|
|
164882
164933
|
}
|
|
164883
164934
|
function shouldRescanGreaterThanToken(node) {
|
|
164884
164935
|
switch (node.kind) {
|
|
@@ -164924,28 +164975,28 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
164924
164975
|
if (lastTokenInfo && expectedScanAction === lastScanAction) {
|
|
164925
164976
|
return fixTokenKind(lastTokenInfo, n);
|
|
164926
164977
|
}
|
|
164927
|
-
if (scanner2.
|
|
164978
|
+
if (scanner2.getTokenFullStart() !== savedPos) {
|
|
164928
164979
|
Debug.assert(lastTokenInfo !== void 0);
|
|
164929
|
-
scanner2.
|
|
164980
|
+
scanner2.resetTokenState(savedPos);
|
|
164930
164981
|
scanner2.scan();
|
|
164931
164982
|
}
|
|
164932
164983
|
let currentToken = getNextToken(n, expectedScanAction);
|
|
164933
164984
|
const token = createTextRangeWithKind(
|
|
164934
|
-
scanner2.
|
|
164935
|
-
scanner2.
|
|
164985
|
+
scanner2.getTokenFullStart(),
|
|
164986
|
+
scanner2.getTokenEnd(),
|
|
164936
164987
|
currentToken
|
|
164937
164988
|
);
|
|
164938
164989
|
if (trailingTrivia) {
|
|
164939
164990
|
trailingTrivia = void 0;
|
|
164940
164991
|
}
|
|
164941
|
-
while (scanner2.
|
|
164992
|
+
while (scanner2.getTokenFullStart() < endPos) {
|
|
164942
164993
|
currentToken = scanner2.scan();
|
|
164943
164994
|
if (!isTrivia(currentToken)) {
|
|
164944
164995
|
break;
|
|
164945
164996
|
}
|
|
164946
164997
|
const trivia = createTextRangeWithKind(
|
|
164947
|
-
scanner2.
|
|
164948
|
-
scanner2.
|
|
164998
|
+
scanner2.getTokenFullStart(),
|
|
164999
|
+
scanner2.getTokenEnd(),
|
|
164949
165000
|
currentToken
|
|
164950
165001
|
);
|
|
164951
165002
|
if (!trailingTrivia) {
|
|
@@ -165010,7 +165061,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
165010
165061
|
}
|
|
165011
165062
|
function readEOFTokenRange() {
|
|
165012
165063
|
Debug.assert(isOnEOF());
|
|
165013
|
-
return createTextRangeWithKind(scanner2.
|
|
165064
|
+
return createTextRangeWithKind(scanner2.getTokenFullStart(), scanner2.getTokenEnd(), 1 /* EndOfFileToken */);
|
|
165014
165065
|
}
|
|
165015
165066
|
function isOnToken() {
|
|
165016
165067
|
const current = lastTokenInfo ? lastTokenInfo.token.kind : scanner2.getToken();
|
|
@@ -165027,8 +165078,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
165027
165078
|
return tokenInfo;
|
|
165028
165079
|
}
|
|
165029
165080
|
function skipToEndOf(node) {
|
|
165030
|
-
scanner2.
|
|
165031
|
-
savedPos = scanner2.
|
|
165081
|
+
scanner2.resetTokenState(node.end);
|
|
165082
|
+
savedPos = scanner2.getTokenFullStart();
|
|
165032
165083
|
lastScanAction = void 0;
|
|
165033
165084
|
lastTokenInfo = void 0;
|
|
165034
165085
|
wasNewLine = false;
|
|
@@ -165036,8 +165087,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
165036
165087
|
trailingTrivia = void 0;
|
|
165037
165088
|
}
|
|
165038
165089
|
function skipToStartOf(node) {
|
|
165039
|
-
scanner2.
|
|
165040
|
-
savedPos = scanner2.
|
|
165090
|
+
scanner2.resetTokenState(node.pos);
|
|
165091
|
+
savedPos = scanner2.getTokenFullStart();
|
|
165041
165092
|
lastScanAction = void 0;
|
|
165042
165093
|
lastTokenInfo = void 0;
|
|
165043
165094
|
wasNewLine = false;
|
|
@@ -166153,7 +166204,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
166153
166204
|
}
|
|
166154
166205
|
}
|
|
166155
166206
|
}
|
|
166156
|
-
if (previousRange && formattingScanner.
|
|
166207
|
+
if (previousRange && formattingScanner.getTokenFullStart() >= originalRange.end) {
|
|
166157
166208
|
const tokenInfo = formattingScanner.isOnEOF() ? formattingScanner.readEOFTokenRange() : formattingScanner.isOnToken() ? formattingScanner.readTokenInfo(enclosingNode).token : void 0;
|
|
166158
166209
|
if (tokenInfo && tokenInfo.pos === previousRangeTriviaEnd) {
|
|
166159
166210
|
const parent2 = ((_a2 = findPrecedingToken(tokenInfo.end, sourceFile, enclosingNode)) == null ? void 0 : _a2.parent) || previousParent;
|
|
@@ -166331,7 +166382,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
166331
166382
|
processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation);
|
|
166332
166383
|
}
|
|
166333
166384
|
);
|
|
166334
|
-
while (formattingScanner.isOnToken() && formattingScanner.
|
|
166385
|
+
while (formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) {
|
|
166335
166386
|
const tokenInfo = formattingScanner.readTokenInfo(node);
|
|
166336
166387
|
if (tokenInfo.token.end > Math.min(node.end, originalRange.end)) {
|
|
166337
166388
|
break;
|
|
@@ -166365,7 +166416,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
166365
166416
|
if (child.getFullWidth() === 0) {
|
|
166366
166417
|
return inheritedIndentation;
|
|
166367
166418
|
}
|
|
166368
|
-
while (formattingScanner.isOnToken() && formattingScanner.
|
|
166419
|
+
while (formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) {
|
|
166369
166420
|
const tokenInfo = formattingScanner.readTokenInfo(node);
|
|
166370
166421
|
if (tokenInfo.token.end > originalRange.end) {
|
|
166371
166422
|
return inheritedIndentation;
|
|
@@ -166378,7 +166429,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
166378
166429
|
}
|
|
166379
166430
|
consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, node);
|
|
166380
166431
|
}
|
|
166381
|
-
if (!formattingScanner.isOnToken() || formattingScanner.
|
|
166432
|
+
if (!formattingScanner.isOnToken() || formattingScanner.getTokenFullStart() >= originalRange.end) {
|
|
166382
166433
|
return inheritedIndentation;
|
|
166383
166434
|
}
|
|
166384
166435
|
if (isToken(child)) {
|
|
@@ -166411,7 +166462,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
166411
166462
|
return;
|
|
166412
166463
|
}
|
|
166413
166464
|
if (listStartToken !== 0 /* Unknown */) {
|
|
166414
|
-
while (formattingScanner.isOnToken() && formattingScanner.
|
|
166465
|
+
while (formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) {
|
|
166415
166466
|
const tokenInfo = formattingScanner.readTokenInfo(parent2);
|
|
166416
166467
|
if (tokenInfo.token.end > nodes.pos) {
|
|
166417
166468
|
break;
|
|
@@ -166448,7 +166499,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
166448
166499
|
);
|
|
166449
166500
|
}
|
|
166450
166501
|
const listEndToken = getCloseTokenForOpenToken(listStartToken);
|
|
166451
|
-
if (listEndToken !== 0 /* Unknown */ && formattingScanner.isOnToken() && formattingScanner.
|
|
166502
|
+
if (listEndToken !== 0 /* Unknown */ && formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) {
|
|
166452
166503
|
let tokenInfo = formattingScanner.readTokenInfo(parent2);
|
|
166453
166504
|
if (tokenInfo.token.kind === 27 /* CommaToken */) {
|
|
166454
166505
|
consumeTokenAndAdvanceScanner(tokenInfo, parent2, listDynamicIndentation, parent2);
|
|
@@ -167727,7 +167778,6 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
167727
167778
|
ContextFlags: () => ContextFlags,
|
|
167728
167779
|
CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter,
|
|
167729
167780
|
Debug: () => Debug,
|
|
167730
|
-
DeprecationVersion: () => DeprecationVersion,
|
|
167731
167781
|
DiagnosticCategory: () => DiagnosticCategory,
|
|
167732
167782
|
Diagnostics: () => Diagnostics,
|
|
167733
167783
|
DocumentHighlights: () => DocumentHighlights,
|