typescript 4.2.0-insiders.20210210 → 4.2.4
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/lib.es2020.intl.d.ts +2 -235
- package/lib/protocol.d.ts +63 -0
- package/lib/tsc.js +38 -19
- package/lib/tsserver.js +76 -30
- package/lib/tsserverlibrary.d.ts +62 -0
- package/lib/tsserverlibrary.js +76 -30
- package/lib/typescript.js +48 -30
- package/lib/typescriptServices.js +48 -30
- package/lib/typingsInstaller.js +39 -19
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -96,7 +96,7 @@ var ts;
|
|
|
96
96
|
// The following is baselined as a literal template type without intervention
|
|
97
97
|
/** The version of the TypeScript compiler release */
|
|
98
98
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
99
|
-
ts.version =
|
|
99
|
+
ts.version = "4.2.4";
|
|
100
100
|
/* @internal */
|
|
101
101
|
var Comparison;
|
|
102
102
|
(function (Comparison) {
|
|
@@ -7005,13 +7005,13 @@ var ts;
|
|
|
7005
7005
|
}
|
|
7006
7006
|
var activeSession;
|
|
7007
7007
|
var profilePath = "./profile.cpuprofile";
|
|
7008
|
-
var realpathSync = (_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync;
|
|
7009
7008
|
var Buffer = require("buffer").Buffer;
|
|
7010
7009
|
var nodeVersion = getNodeMajorVersion();
|
|
7011
7010
|
var isNode4OrLater = nodeVersion >= 4;
|
|
7012
7011
|
var isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
|
7013
7012
|
var platform = _os.platform();
|
|
7014
7013
|
var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
|
|
7014
|
+
var realpathSync = useCaseSensitiveFileNames ? ((_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync) : _fs.realpathSync;
|
|
7015
7015
|
var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
|
|
7016
7016
|
var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
|
|
7017
7017
|
var _c = createSystemWatchFunctions({
|
|
@@ -46983,7 +46983,9 @@ var ts;
|
|
|
46983
46983
|
var result = new Type(checker, flags);
|
|
46984
46984
|
typeCount++;
|
|
46985
46985
|
result.id = typeCount;
|
|
46986
|
-
|
|
46986
|
+
if (ts.tracing) {
|
|
46987
|
+
typeCatalog.push(result);
|
|
46988
|
+
}
|
|
46987
46989
|
return result;
|
|
46988
46990
|
}
|
|
46989
46991
|
function createOriginType(flags) {
|
|
@@ -47044,13 +47046,17 @@ var ts;
|
|
|
47044
47046
|
return result || ts.emptyArray;
|
|
47045
47047
|
}
|
|
47046
47048
|
function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
|
|
47047
|
-
|
|
47048
|
-
|
|
47049
|
-
|
|
47050
|
-
|
|
47051
|
-
|
|
47052
|
-
|
|
47053
|
-
|
|
47049
|
+
var resolved = type;
|
|
47050
|
+
resolved.members = members;
|
|
47051
|
+
resolved.properties = ts.emptyArray;
|
|
47052
|
+
resolved.callSignatures = callSignatures;
|
|
47053
|
+
resolved.constructSignatures = constructSignatures;
|
|
47054
|
+
resolved.stringIndexInfo = stringIndexInfo;
|
|
47055
|
+
resolved.numberIndexInfo = numberIndexInfo;
|
|
47056
|
+
// This can loop back to getPropertyOfType() which would crash if `callSignatures` & `constructSignatures` are not initialized.
|
|
47057
|
+
if (members !== emptySymbols)
|
|
47058
|
+
resolved.properties = getNamedMembers(members);
|
|
47059
|
+
return resolved;
|
|
47054
47060
|
}
|
|
47055
47061
|
function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
|
|
47056
47062
|
return setStructuredTypeMembers(createObjectType(16 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
|
|
@@ -55677,7 +55683,7 @@ var ts;
|
|
|
55677
55683
|
}
|
|
55678
55684
|
return true;
|
|
55679
55685
|
}
|
|
55680
|
-
function removeRedundantLiteralTypes(types, includes) {
|
|
55686
|
+
function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) {
|
|
55681
55687
|
var i = types.length;
|
|
55682
55688
|
while (i > 0) {
|
|
55683
55689
|
i--;
|
|
@@ -55687,7 +55693,7 @@ var ts;
|
|
|
55687
55693
|
flags & 256 /* NumberLiteral */ && includes & 8 /* Number */ ||
|
|
55688
55694
|
flags & 2048 /* BigIntLiteral */ && includes & 64 /* BigInt */ ||
|
|
55689
55695
|
flags & 8192 /* UniqueESSymbol */ && includes & 4096 /* ESSymbol */ ||
|
|
55690
|
-
flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
|
|
55696
|
+
reduceVoidUndefined && flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
|
|
55691
55697
|
isFreshLiteralType(t) && containsType(types, t.regularType);
|
|
55692
55698
|
if (remove) {
|
|
55693
55699
|
ts.orderedRemoveItemAt(types, i);
|
|
@@ -55719,7 +55725,7 @@ var ts;
|
|
|
55719
55725
|
if (t.flags & 1048576 /* Union */) {
|
|
55720
55726
|
var origin = t.origin;
|
|
55721
55727
|
if (t.aliasSymbol || origin && !(origin.flags & 1048576 /* Union */)) {
|
|
55722
|
-
|
|
55728
|
+
ts.pushIfUnique(namedUnions, t);
|
|
55723
55729
|
}
|
|
55724
55730
|
else if (origin && origin.flags & 1048576 /* Union */) {
|
|
55725
55731
|
addNamedUnions(namedUnions, origin.types);
|
|
@@ -55755,7 +55761,7 @@ var ts;
|
|
|
55755
55761
|
}
|
|
55756
55762
|
if (unionReduction & (1 /* Literal */ | 2 /* Subtype */)) {
|
|
55757
55763
|
if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
|
|
55758
|
-
removeRedundantLiteralTypes(typeSet, includes);
|
|
55764
|
+
removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
|
|
55759
55765
|
}
|
|
55760
55766
|
if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
|
|
55761
55767
|
removeStringLiteralsMatchedByTemplateLiterals(typeSet);
|
|
@@ -63776,7 +63782,16 @@ var ts;
|
|
|
63776
63782
|
var type = getTypeOfDottedName(node.expression, diagnostic);
|
|
63777
63783
|
if (type) {
|
|
63778
63784
|
var name = node.name;
|
|
63779
|
-
var prop =
|
|
63785
|
+
var prop = void 0;
|
|
63786
|
+
if (ts.isPrivateIdentifier(name)) {
|
|
63787
|
+
if (!type.symbol) {
|
|
63788
|
+
return undefined;
|
|
63789
|
+
}
|
|
63790
|
+
prop = getPropertyOfType(type, ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText));
|
|
63791
|
+
}
|
|
63792
|
+
else {
|
|
63793
|
+
prop = getPropertyOfType(type, name.escapedText);
|
|
63794
|
+
}
|
|
63780
63795
|
return prop && getExplicitTypeOfSymbol(prop, diagnostic);
|
|
63781
63796
|
}
|
|
63782
63797
|
return undefined;
|
|
@@ -75193,7 +75208,9 @@ var ts;
|
|
|
75193
75208
|
: ts.isPropertyAccessExpression(location) ? location.name
|
|
75194
75209
|
: ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
|
|
75195
75210
|
: undefined;
|
|
75196
|
-
|
|
75211
|
+
var isPropertyExpressionCast = ts.isPropertyAccessExpression(location)
|
|
75212
|
+
&& ts.isAssertionExpression(ts.skipParentheses(location.expression));
|
|
75213
|
+
if (!testedNode || isPropertyExpressionCast) {
|
|
75197
75214
|
return;
|
|
75198
75215
|
}
|
|
75199
75216
|
var possiblyFalsy = getFalsyFlags(type);
|
|
@@ -77343,6 +77360,7 @@ var ts;
|
|
|
77343
77360
|
return true;
|
|
77344
77361
|
}
|
|
77345
77362
|
function checkAliasSymbol(node) {
|
|
77363
|
+
var _a;
|
|
77346
77364
|
var symbol = getSymbolOfNode(node);
|
|
77347
77365
|
var target = resolveAlias(symbol);
|
|
77348
77366
|
if (target !== unknownSymbol) {
|
|
@@ -77370,7 +77388,7 @@ var ts;
|
|
|
77370
77388
|
&& !(node.flags & 8388608 /* Ambient */)) {
|
|
77371
77389
|
error(node, ts.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);
|
|
77372
77390
|
}
|
|
77373
|
-
if (ts.isImportSpecifier(node) &&
|
|
77391
|
+
if (ts.isImportSpecifier(node) && ((_a = target.declarations) === null || _a === void 0 ? void 0 : _a.every(function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); }))) {
|
|
77374
77392
|
addDeprecatedSuggestion(node.name, target.declarations, symbol.escapedName);
|
|
77375
77393
|
}
|
|
77376
77394
|
}
|
|
@@ -111475,10 +111493,11 @@ var ts;
|
|
|
111475
111493
|
var redirects = host.redirectTargetsMap.get(importedPath) || ts.emptyArray;
|
|
111476
111494
|
var importedFileNames = __spreadArray(__spreadArray(__spreadArray([], (referenceRedirect ? [referenceRedirect] : ts.emptyArray)), [importedFileName]), redirects);
|
|
111477
111495
|
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
|
|
111496
|
+
var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
|
|
111478
111497
|
if (!preferSymlinks) {
|
|
111479
111498
|
// Symlinks inside ignored paths are already filtered out of the symlink cache,
|
|
111480
111499
|
// so we only need to remove them from the realpath filenames.
|
|
111481
|
-
var result_15 = ts.forEach(targets, function (p) { return !ts.containsIgnoredPath(p) && cb(p, referenceRedirect === p); });
|
|
111500
|
+
var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
111482
111501
|
if (result_15)
|
|
111483
111502
|
return result_15;
|
|
111484
111503
|
}
|
|
@@ -111504,13 +111523,14 @@ var ts;
|
|
|
111504
111523
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
111505
111524
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
111506
111525
|
var result_16 = cb(option, target === referenceRedirect);
|
|
111526
|
+
shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
|
|
111507
111527
|
if (result_16)
|
|
111508
111528
|
return result_16;
|
|
111509
111529
|
}
|
|
111510
111530
|
});
|
|
111511
111531
|
});
|
|
111512
111532
|
return result || (preferSymlinks
|
|
111513
|
-
? ts.forEach(targets, function (p) { return ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
|
|
111533
|
+
? ts.forEach(targets, function (p) { return shouldFilterIgnoredPaths && ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
|
|
111514
111534
|
: undefined);
|
|
111515
111535
|
}
|
|
111516
111536
|
moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule;
|
|
@@ -139585,7 +139605,7 @@ var ts;
|
|
|
139585
139605
|
}
|
|
139586
139606
|
function addFunctionDeclaration(changes, context, info) {
|
|
139587
139607
|
var importAdder = codefix.createImportAdder(context.sourceFile, context.program, context.preferences, context.host);
|
|
139588
|
-
var functionDeclaration = codefix.createSignatureDeclarationFromCallExpression(251 /* FunctionDeclaration */, context, importAdder, info.call, info.token, info.modifierFlags, info.parentDeclaration);
|
|
139608
|
+
var functionDeclaration = codefix.createSignatureDeclarationFromCallExpression(251 /* FunctionDeclaration */, context, importAdder, info.call, ts.idText(info.token), info.modifierFlags, info.parentDeclaration);
|
|
139589
139609
|
changes.insertNodeAtEndOfScope(info.sourceFile, info.parentDeclaration, functionDeclaration);
|
|
139590
139610
|
}
|
|
139591
139611
|
})(codefix = ts.codefix || (ts.codefix = {}));
|
|
@@ -148401,7 +148421,7 @@ var ts;
|
|
|
148401
148421
|
};
|
|
148402
148422
|
SignatureObject.prototype.getJsDocTags = function () {
|
|
148403
148423
|
if (this.jsDocTags === undefined) {
|
|
148404
|
-
this.jsDocTags = this.declaration ?
|
|
148424
|
+
this.jsDocTags = this.declaration ? getJsDocTagsOfSignature(this.declaration, this.checker) : [];
|
|
148405
148425
|
}
|
|
148406
148426
|
return this.jsDocTags;
|
|
148407
148427
|
};
|
|
@@ -148415,15 +148435,13 @@ var ts;
|
|
|
148415
148435
|
function hasJSDocInheritDocTag(node) {
|
|
148416
148436
|
return ts.getJSDocTags(node).some(function (tag) { return tag.tagName.text === "inheritDoc"; });
|
|
148417
148437
|
}
|
|
148418
|
-
function
|
|
148419
|
-
var tags = ts.JsDoc.getJsDocTagsFromDeclarations(
|
|
148420
|
-
if (tags.length === 0 ||
|
|
148421
|
-
|
|
148422
|
-
|
|
148423
|
-
|
|
148424
|
-
|
|
148425
|
-
}
|
|
148426
|
-
});
|
|
148438
|
+
function getJsDocTagsOfSignature(declaration, checker) {
|
|
148439
|
+
var tags = ts.JsDoc.getJsDocTagsFromDeclarations([declaration]);
|
|
148440
|
+
if (tags.length === 0 || hasJSDocInheritDocTag(declaration)) {
|
|
148441
|
+
var inheritedTags = findBaseOfDeclaration(checker, declaration, function (symbol) { var _a; return ((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.length) === 1 ? symbol.getJsDocTags() : undefined; });
|
|
148442
|
+
if (inheritedTags) {
|
|
148443
|
+
tags = __spreadArray(__spreadArray([], inheritedTags), tags);
|
|
148444
|
+
}
|
|
148427
148445
|
}
|
|
148428
148446
|
return tags;
|
|
148429
148447
|
}
|
|
@@ -152527,6 +152545,34 @@ var ts;
|
|
|
152527
152545
|
ScriptTarget["ES2020"] = "ES2020";
|
|
152528
152546
|
ScriptTarget["ESNext"] = "ESNext";
|
|
152529
152547
|
})(ScriptTarget = protocol.ScriptTarget || (protocol.ScriptTarget = {}));
|
|
152548
|
+
var ClassificationType;
|
|
152549
|
+
(function (ClassificationType) {
|
|
152550
|
+
ClassificationType[ClassificationType["comment"] = 1] = "comment";
|
|
152551
|
+
ClassificationType[ClassificationType["identifier"] = 2] = "identifier";
|
|
152552
|
+
ClassificationType[ClassificationType["keyword"] = 3] = "keyword";
|
|
152553
|
+
ClassificationType[ClassificationType["numericLiteral"] = 4] = "numericLiteral";
|
|
152554
|
+
ClassificationType[ClassificationType["operator"] = 5] = "operator";
|
|
152555
|
+
ClassificationType[ClassificationType["stringLiteral"] = 6] = "stringLiteral";
|
|
152556
|
+
ClassificationType[ClassificationType["regularExpressionLiteral"] = 7] = "regularExpressionLiteral";
|
|
152557
|
+
ClassificationType[ClassificationType["whiteSpace"] = 8] = "whiteSpace";
|
|
152558
|
+
ClassificationType[ClassificationType["text"] = 9] = "text";
|
|
152559
|
+
ClassificationType[ClassificationType["punctuation"] = 10] = "punctuation";
|
|
152560
|
+
ClassificationType[ClassificationType["className"] = 11] = "className";
|
|
152561
|
+
ClassificationType[ClassificationType["enumName"] = 12] = "enumName";
|
|
152562
|
+
ClassificationType[ClassificationType["interfaceName"] = 13] = "interfaceName";
|
|
152563
|
+
ClassificationType[ClassificationType["moduleName"] = 14] = "moduleName";
|
|
152564
|
+
ClassificationType[ClassificationType["typeParameterName"] = 15] = "typeParameterName";
|
|
152565
|
+
ClassificationType[ClassificationType["typeAliasName"] = 16] = "typeAliasName";
|
|
152566
|
+
ClassificationType[ClassificationType["parameterName"] = 17] = "parameterName";
|
|
152567
|
+
ClassificationType[ClassificationType["docCommentTagName"] = 18] = "docCommentTagName";
|
|
152568
|
+
ClassificationType[ClassificationType["jsxOpenTagName"] = 19] = "jsxOpenTagName";
|
|
152569
|
+
ClassificationType[ClassificationType["jsxCloseTagName"] = 20] = "jsxCloseTagName";
|
|
152570
|
+
ClassificationType[ClassificationType["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName";
|
|
152571
|
+
ClassificationType[ClassificationType["jsxAttribute"] = 22] = "jsxAttribute";
|
|
152572
|
+
ClassificationType[ClassificationType["jsxText"] = 23] = "jsxText";
|
|
152573
|
+
ClassificationType[ClassificationType["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue";
|
|
152574
|
+
ClassificationType[ClassificationType["bigintLiteral"] = 25] = "bigintLiteral";
|
|
152575
|
+
})(ClassificationType = protocol.ClassificationType || (protocol.ClassificationType = {}));
|
|
152530
152576
|
})(protocol = server.protocol || (server.protocol = {}));
|
|
152531
152577
|
})(server = ts.server || (ts.server = {}));
|
|
152532
152578
|
})(ts || (ts = {}));
|
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -7136,6 +7136,41 @@ declare namespace ts.server.protocol {
|
|
|
7136
7136
|
*/
|
|
7137
7137
|
body?: string[];
|
|
7138
7138
|
}
|
|
7139
|
+
/**
|
|
7140
|
+
* A request to get encoded semantic classifications for a span in the file
|
|
7141
|
+
*/
|
|
7142
|
+
interface EncodedSemanticClassificationsRequest extends FileRequest {
|
|
7143
|
+
arguments: EncodedSemanticClassificationsRequestArgs;
|
|
7144
|
+
}
|
|
7145
|
+
/**
|
|
7146
|
+
* Arguments for EncodedSemanticClassificationsRequest request.
|
|
7147
|
+
*/
|
|
7148
|
+
interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs {
|
|
7149
|
+
/**
|
|
7150
|
+
* Start position of the span.
|
|
7151
|
+
*/
|
|
7152
|
+
start: number;
|
|
7153
|
+
/**
|
|
7154
|
+
* Length of the span.
|
|
7155
|
+
*/
|
|
7156
|
+
length: number;
|
|
7157
|
+
/**
|
|
7158
|
+
* Optional parameter for the semantic highlighting response, if absent it
|
|
7159
|
+
* defaults to "original".
|
|
7160
|
+
*/
|
|
7161
|
+
format?: "original" | "2020";
|
|
7162
|
+
}
|
|
7163
|
+
/** The response for a EncodedSemanticClassificationsRequest */
|
|
7164
|
+
interface EncodedSemanticClassificationsResponse extends Response {
|
|
7165
|
+
body?: EncodedSemanticClassificationsResponseBody;
|
|
7166
|
+
}
|
|
7167
|
+
/**
|
|
7168
|
+
* Implementation response message. Gives series of text spans depending on the format ar.
|
|
7169
|
+
*/
|
|
7170
|
+
interface EncodedSemanticClassificationsResponseBody {
|
|
7171
|
+
endOfLineState: EndOfLineState;
|
|
7172
|
+
spans: number[];
|
|
7173
|
+
}
|
|
7139
7174
|
/**
|
|
7140
7175
|
* Arguments in document highlight request; include: filesToSearch, file,
|
|
7141
7176
|
* line, offset.
|
|
@@ -9159,6 +9194,33 @@ declare namespace ts.server.protocol {
|
|
|
9159
9194
|
ES2020 = "ES2020",
|
|
9160
9195
|
ESNext = "ESNext"
|
|
9161
9196
|
}
|
|
9197
|
+
enum ClassificationType {
|
|
9198
|
+
comment = 1,
|
|
9199
|
+
identifier = 2,
|
|
9200
|
+
keyword = 3,
|
|
9201
|
+
numericLiteral = 4,
|
|
9202
|
+
operator = 5,
|
|
9203
|
+
stringLiteral = 6,
|
|
9204
|
+
regularExpressionLiteral = 7,
|
|
9205
|
+
whiteSpace = 8,
|
|
9206
|
+
text = 9,
|
|
9207
|
+
punctuation = 10,
|
|
9208
|
+
className = 11,
|
|
9209
|
+
enumName = 12,
|
|
9210
|
+
interfaceName = 13,
|
|
9211
|
+
moduleName = 14,
|
|
9212
|
+
typeParameterName = 15,
|
|
9213
|
+
typeAliasName = 16,
|
|
9214
|
+
parameterName = 17,
|
|
9215
|
+
docCommentTagName = 18,
|
|
9216
|
+
jsxOpenTagName = 19,
|
|
9217
|
+
jsxCloseTagName = 20,
|
|
9218
|
+
jsxSelfClosingTagName = 21,
|
|
9219
|
+
jsxAttribute = 22,
|
|
9220
|
+
jsxText = 23,
|
|
9221
|
+
jsxAttributeStringLiteralValue = 24,
|
|
9222
|
+
bigintLiteral = 25
|
|
9223
|
+
}
|
|
9162
9224
|
}
|
|
9163
9225
|
declare namespace ts.server {
|
|
9164
9226
|
interface ScriptInfoVersion {
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -290,7 +290,7 @@ var ts;
|
|
|
290
290
|
// The following is baselined as a literal template type without intervention
|
|
291
291
|
/** The version of the TypeScript compiler release */
|
|
292
292
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
293
|
-
ts.version =
|
|
293
|
+
ts.version = "4.2.4";
|
|
294
294
|
/* @internal */
|
|
295
295
|
var Comparison;
|
|
296
296
|
(function (Comparison) {
|
|
@@ -7199,13 +7199,13 @@ var ts;
|
|
|
7199
7199
|
}
|
|
7200
7200
|
var activeSession;
|
|
7201
7201
|
var profilePath = "./profile.cpuprofile";
|
|
7202
|
-
var realpathSync = (_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync;
|
|
7203
7202
|
var Buffer = require("buffer").Buffer;
|
|
7204
7203
|
var nodeVersion = getNodeMajorVersion();
|
|
7205
7204
|
var isNode4OrLater = nodeVersion >= 4;
|
|
7206
7205
|
var isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
|
7207
7206
|
var platform = _os.platform();
|
|
7208
7207
|
var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
|
|
7208
|
+
var realpathSync = useCaseSensitiveFileNames ? ((_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync) : _fs.realpathSync;
|
|
7209
7209
|
var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
|
|
7210
7210
|
var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
|
|
7211
7211
|
var _c = createSystemWatchFunctions({
|
|
@@ -47177,7 +47177,9 @@ var ts;
|
|
|
47177
47177
|
var result = new Type(checker, flags);
|
|
47178
47178
|
typeCount++;
|
|
47179
47179
|
result.id = typeCount;
|
|
47180
|
-
|
|
47180
|
+
if (ts.tracing) {
|
|
47181
|
+
typeCatalog.push(result);
|
|
47182
|
+
}
|
|
47181
47183
|
return result;
|
|
47182
47184
|
}
|
|
47183
47185
|
function createOriginType(flags) {
|
|
@@ -47238,13 +47240,17 @@ var ts;
|
|
|
47238
47240
|
return result || ts.emptyArray;
|
|
47239
47241
|
}
|
|
47240
47242
|
function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
|
|
47241
|
-
|
|
47242
|
-
|
|
47243
|
-
|
|
47244
|
-
|
|
47245
|
-
|
|
47246
|
-
|
|
47247
|
-
|
|
47243
|
+
var resolved = type;
|
|
47244
|
+
resolved.members = members;
|
|
47245
|
+
resolved.properties = ts.emptyArray;
|
|
47246
|
+
resolved.callSignatures = callSignatures;
|
|
47247
|
+
resolved.constructSignatures = constructSignatures;
|
|
47248
|
+
resolved.stringIndexInfo = stringIndexInfo;
|
|
47249
|
+
resolved.numberIndexInfo = numberIndexInfo;
|
|
47250
|
+
// This can loop back to getPropertyOfType() which would crash if `callSignatures` & `constructSignatures` are not initialized.
|
|
47251
|
+
if (members !== emptySymbols)
|
|
47252
|
+
resolved.properties = getNamedMembers(members);
|
|
47253
|
+
return resolved;
|
|
47248
47254
|
}
|
|
47249
47255
|
function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
|
|
47250
47256
|
return setStructuredTypeMembers(createObjectType(16 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
|
|
@@ -55871,7 +55877,7 @@ var ts;
|
|
|
55871
55877
|
}
|
|
55872
55878
|
return true;
|
|
55873
55879
|
}
|
|
55874
|
-
function removeRedundantLiteralTypes(types, includes) {
|
|
55880
|
+
function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) {
|
|
55875
55881
|
var i = types.length;
|
|
55876
55882
|
while (i > 0) {
|
|
55877
55883
|
i--;
|
|
@@ -55881,7 +55887,7 @@ var ts;
|
|
|
55881
55887
|
flags & 256 /* NumberLiteral */ && includes & 8 /* Number */ ||
|
|
55882
55888
|
flags & 2048 /* BigIntLiteral */ && includes & 64 /* BigInt */ ||
|
|
55883
55889
|
flags & 8192 /* UniqueESSymbol */ && includes & 4096 /* ESSymbol */ ||
|
|
55884
|
-
flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
|
|
55890
|
+
reduceVoidUndefined && flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
|
|
55885
55891
|
isFreshLiteralType(t) && containsType(types, t.regularType);
|
|
55886
55892
|
if (remove) {
|
|
55887
55893
|
ts.orderedRemoveItemAt(types, i);
|
|
@@ -55913,7 +55919,7 @@ var ts;
|
|
|
55913
55919
|
if (t.flags & 1048576 /* Union */) {
|
|
55914
55920
|
var origin = t.origin;
|
|
55915
55921
|
if (t.aliasSymbol || origin && !(origin.flags & 1048576 /* Union */)) {
|
|
55916
|
-
|
|
55922
|
+
ts.pushIfUnique(namedUnions, t);
|
|
55917
55923
|
}
|
|
55918
55924
|
else if (origin && origin.flags & 1048576 /* Union */) {
|
|
55919
55925
|
addNamedUnions(namedUnions, origin.types);
|
|
@@ -55949,7 +55955,7 @@ var ts;
|
|
|
55949
55955
|
}
|
|
55950
55956
|
if (unionReduction & (1 /* Literal */ | 2 /* Subtype */)) {
|
|
55951
55957
|
if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
|
|
55952
|
-
removeRedundantLiteralTypes(typeSet, includes);
|
|
55958
|
+
removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
|
|
55953
55959
|
}
|
|
55954
55960
|
if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
|
|
55955
55961
|
removeStringLiteralsMatchedByTemplateLiterals(typeSet);
|
|
@@ -63970,7 +63976,16 @@ var ts;
|
|
|
63970
63976
|
var type = getTypeOfDottedName(node.expression, diagnostic);
|
|
63971
63977
|
if (type) {
|
|
63972
63978
|
var name = node.name;
|
|
63973
|
-
var prop =
|
|
63979
|
+
var prop = void 0;
|
|
63980
|
+
if (ts.isPrivateIdentifier(name)) {
|
|
63981
|
+
if (!type.symbol) {
|
|
63982
|
+
return undefined;
|
|
63983
|
+
}
|
|
63984
|
+
prop = getPropertyOfType(type, ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText));
|
|
63985
|
+
}
|
|
63986
|
+
else {
|
|
63987
|
+
prop = getPropertyOfType(type, name.escapedText);
|
|
63988
|
+
}
|
|
63974
63989
|
return prop && getExplicitTypeOfSymbol(prop, diagnostic);
|
|
63975
63990
|
}
|
|
63976
63991
|
return undefined;
|
|
@@ -75387,7 +75402,9 @@ var ts;
|
|
|
75387
75402
|
: ts.isPropertyAccessExpression(location) ? location.name
|
|
75388
75403
|
: ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
|
|
75389
75404
|
: undefined;
|
|
75390
|
-
|
|
75405
|
+
var isPropertyExpressionCast = ts.isPropertyAccessExpression(location)
|
|
75406
|
+
&& ts.isAssertionExpression(ts.skipParentheses(location.expression));
|
|
75407
|
+
if (!testedNode || isPropertyExpressionCast) {
|
|
75391
75408
|
return;
|
|
75392
75409
|
}
|
|
75393
75410
|
var possiblyFalsy = getFalsyFlags(type);
|
|
@@ -77537,6 +77554,7 @@ var ts;
|
|
|
77537
77554
|
return true;
|
|
77538
77555
|
}
|
|
77539
77556
|
function checkAliasSymbol(node) {
|
|
77557
|
+
var _a;
|
|
77540
77558
|
var symbol = getSymbolOfNode(node);
|
|
77541
77559
|
var target = resolveAlias(symbol);
|
|
77542
77560
|
if (target !== unknownSymbol) {
|
|
@@ -77564,7 +77582,7 @@ var ts;
|
|
|
77564
77582
|
&& !(node.flags & 8388608 /* Ambient */)) {
|
|
77565
77583
|
error(node, ts.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);
|
|
77566
77584
|
}
|
|
77567
|
-
if (ts.isImportSpecifier(node) &&
|
|
77585
|
+
if (ts.isImportSpecifier(node) && ((_a = target.declarations) === null || _a === void 0 ? void 0 : _a.every(function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); }))) {
|
|
77568
77586
|
addDeprecatedSuggestion(node.name, target.declarations, symbol.escapedName);
|
|
77569
77587
|
}
|
|
77570
77588
|
}
|
|
@@ -111669,10 +111687,11 @@ var ts;
|
|
|
111669
111687
|
var redirects = host.redirectTargetsMap.get(importedPath) || ts.emptyArray;
|
|
111670
111688
|
var importedFileNames = __spreadArray(__spreadArray(__spreadArray([], (referenceRedirect ? [referenceRedirect] : ts.emptyArray)), [importedFileName]), redirects);
|
|
111671
111689
|
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
|
|
111690
|
+
var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
|
|
111672
111691
|
if (!preferSymlinks) {
|
|
111673
111692
|
// Symlinks inside ignored paths are already filtered out of the symlink cache,
|
|
111674
111693
|
// so we only need to remove them from the realpath filenames.
|
|
111675
|
-
var result_15 = ts.forEach(targets, function (p) { return !ts.containsIgnoredPath(p) && cb(p, referenceRedirect === p); });
|
|
111694
|
+
var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
111676
111695
|
if (result_15)
|
|
111677
111696
|
return result_15;
|
|
111678
111697
|
}
|
|
@@ -111698,13 +111717,14 @@ var ts;
|
|
|
111698
111717
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
111699
111718
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
111700
111719
|
var result_16 = cb(option, target === referenceRedirect);
|
|
111720
|
+
shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
|
|
111701
111721
|
if (result_16)
|
|
111702
111722
|
return result_16;
|
|
111703
111723
|
}
|
|
111704
111724
|
});
|
|
111705
111725
|
});
|
|
111706
111726
|
return result || (preferSymlinks
|
|
111707
|
-
? ts.forEach(targets, function (p) { return ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
|
|
111727
|
+
? ts.forEach(targets, function (p) { return shouldFilterIgnoredPaths && ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
|
|
111708
111728
|
: undefined);
|
|
111709
111729
|
}
|
|
111710
111730
|
moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule;
|
|
@@ -140154,7 +140174,7 @@ var ts;
|
|
|
140154
140174
|
}
|
|
140155
140175
|
function addFunctionDeclaration(changes, context, info) {
|
|
140156
140176
|
var importAdder = codefix.createImportAdder(context.sourceFile, context.program, context.preferences, context.host);
|
|
140157
|
-
var functionDeclaration = codefix.createSignatureDeclarationFromCallExpression(251 /* FunctionDeclaration */, context, importAdder, info.call, info.token, info.modifierFlags, info.parentDeclaration);
|
|
140177
|
+
var functionDeclaration = codefix.createSignatureDeclarationFromCallExpression(251 /* FunctionDeclaration */, context, importAdder, info.call, ts.idText(info.token), info.modifierFlags, info.parentDeclaration);
|
|
140158
140178
|
changes.insertNodeAtEndOfScope(info.sourceFile, info.parentDeclaration, functionDeclaration);
|
|
140159
140179
|
}
|
|
140160
140180
|
})(codefix = ts.codefix || (ts.codefix = {}));
|
|
@@ -148970,7 +148990,7 @@ var ts;
|
|
|
148970
148990
|
};
|
|
148971
148991
|
SignatureObject.prototype.getJsDocTags = function () {
|
|
148972
148992
|
if (this.jsDocTags === undefined) {
|
|
148973
|
-
this.jsDocTags = this.declaration ?
|
|
148993
|
+
this.jsDocTags = this.declaration ? getJsDocTagsOfSignature(this.declaration, this.checker) : [];
|
|
148974
148994
|
}
|
|
148975
148995
|
return this.jsDocTags;
|
|
148976
148996
|
};
|
|
@@ -148984,15 +149004,13 @@ var ts;
|
|
|
148984
149004
|
function hasJSDocInheritDocTag(node) {
|
|
148985
149005
|
return ts.getJSDocTags(node).some(function (tag) { return tag.tagName.text === "inheritDoc"; });
|
|
148986
149006
|
}
|
|
148987
|
-
function
|
|
148988
|
-
var tags = ts.JsDoc.getJsDocTagsFromDeclarations(
|
|
148989
|
-
if (tags.length === 0 ||
|
|
148990
|
-
|
|
148991
|
-
|
|
148992
|
-
|
|
148993
|
-
|
|
148994
|
-
}
|
|
148995
|
-
});
|
|
149007
|
+
function getJsDocTagsOfSignature(declaration, checker) {
|
|
149008
|
+
var tags = ts.JsDoc.getJsDocTagsFromDeclarations([declaration]);
|
|
149009
|
+
if (tags.length === 0 || hasJSDocInheritDocTag(declaration)) {
|
|
149010
|
+
var inheritedTags = findBaseOfDeclaration(checker, declaration, function (symbol) { var _a; return ((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.length) === 1 ? symbol.getJsDocTags() : undefined; });
|
|
149011
|
+
if (inheritedTags) {
|
|
149012
|
+
tags = __spreadArray(__spreadArray([], inheritedTags), tags);
|
|
149013
|
+
}
|
|
148996
149014
|
}
|
|
148997
149015
|
return tags;
|
|
148998
149016
|
}
|
|
@@ -152721,6 +152739,34 @@ var ts;
|
|
|
152721
152739
|
ScriptTarget["ES2020"] = "ES2020";
|
|
152722
152740
|
ScriptTarget["ESNext"] = "ESNext";
|
|
152723
152741
|
})(ScriptTarget = protocol.ScriptTarget || (protocol.ScriptTarget = {}));
|
|
152742
|
+
var ClassificationType;
|
|
152743
|
+
(function (ClassificationType) {
|
|
152744
|
+
ClassificationType[ClassificationType["comment"] = 1] = "comment";
|
|
152745
|
+
ClassificationType[ClassificationType["identifier"] = 2] = "identifier";
|
|
152746
|
+
ClassificationType[ClassificationType["keyword"] = 3] = "keyword";
|
|
152747
|
+
ClassificationType[ClassificationType["numericLiteral"] = 4] = "numericLiteral";
|
|
152748
|
+
ClassificationType[ClassificationType["operator"] = 5] = "operator";
|
|
152749
|
+
ClassificationType[ClassificationType["stringLiteral"] = 6] = "stringLiteral";
|
|
152750
|
+
ClassificationType[ClassificationType["regularExpressionLiteral"] = 7] = "regularExpressionLiteral";
|
|
152751
|
+
ClassificationType[ClassificationType["whiteSpace"] = 8] = "whiteSpace";
|
|
152752
|
+
ClassificationType[ClassificationType["text"] = 9] = "text";
|
|
152753
|
+
ClassificationType[ClassificationType["punctuation"] = 10] = "punctuation";
|
|
152754
|
+
ClassificationType[ClassificationType["className"] = 11] = "className";
|
|
152755
|
+
ClassificationType[ClassificationType["enumName"] = 12] = "enumName";
|
|
152756
|
+
ClassificationType[ClassificationType["interfaceName"] = 13] = "interfaceName";
|
|
152757
|
+
ClassificationType[ClassificationType["moduleName"] = 14] = "moduleName";
|
|
152758
|
+
ClassificationType[ClassificationType["typeParameterName"] = 15] = "typeParameterName";
|
|
152759
|
+
ClassificationType[ClassificationType["typeAliasName"] = 16] = "typeAliasName";
|
|
152760
|
+
ClassificationType[ClassificationType["parameterName"] = 17] = "parameterName";
|
|
152761
|
+
ClassificationType[ClassificationType["docCommentTagName"] = 18] = "docCommentTagName";
|
|
152762
|
+
ClassificationType[ClassificationType["jsxOpenTagName"] = 19] = "jsxOpenTagName";
|
|
152763
|
+
ClassificationType[ClassificationType["jsxCloseTagName"] = 20] = "jsxCloseTagName";
|
|
152764
|
+
ClassificationType[ClassificationType["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName";
|
|
152765
|
+
ClassificationType[ClassificationType["jsxAttribute"] = 22] = "jsxAttribute";
|
|
152766
|
+
ClassificationType[ClassificationType["jsxText"] = 23] = "jsxText";
|
|
152767
|
+
ClassificationType[ClassificationType["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue";
|
|
152768
|
+
ClassificationType[ClassificationType["bigintLiteral"] = 25] = "bigintLiteral";
|
|
152769
|
+
})(ClassificationType = protocol.ClassificationType || (protocol.ClassificationType = {}));
|
|
152724
152770
|
})(protocol = server.protocol || (server.protocol = {}));
|
|
152725
152771
|
})(server = ts.server || (ts.server = {}));
|
|
152726
152772
|
})(ts || (ts = {}));
|