@typescript-deploys/pr-build 5.4.0-pr-56281-22 → 5.4.0-pr-56356-2
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.es5.d.ts +0 -12
- package/lib/tsc.js +103 -115
- package/lib/tsserver.js +166 -121
- package/lib/typescript.d.ts +3 -1
- package/lib/typescript.js +166 -121
- package/lib/typingsInstaller.js +32 -21
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -2330,7 +2330,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2330
2330
|
|
|
2331
2331
|
// src/compiler/corePublic.ts
|
|
2332
2332
|
var versionMajorMinor = "5.4";
|
|
2333
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2333
|
+
var version = `${versionMajorMinor}.0-insiders.20231109`;
|
|
2334
2334
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2335
2335
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2336
2336
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6402,6 +6402,7 @@ var TypeFormatFlags = /* @__PURE__ */ ((TypeFormatFlags2) => {
|
|
|
6402
6402
|
TypeFormatFlags2[TypeFormatFlags2["None"] = 0] = "None";
|
|
6403
6403
|
TypeFormatFlags2[TypeFormatFlags2["NoTruncation"] = 1] = "NoTruncation";
|
|
6404
6404
|
TypeFormatFlags2[TypeFormatFlags2["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType";
|
|
6405
|
+
TypeFormatFlags2[TypeFormatFlags2["GenerateNamesForShadowedTypeParams"] = 4] = "GenerateNamesForShadowedTypeParams";
|
|
6405
6406
|
TypeFormatFlags2[TypeFormatFlags2["UseStructuralFallback"] = 8] = "UseStructuralFallback";
|
|
6406
6407
|
TypeFormatFlags2[TypeFormatFlags2["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature";
|
|
6407
6408
|
TypeFormatFlags2[TypeFormatFlags2["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType";
|
|
@@ -6421,7 +6422,7 @@ var TypeFormatFlags = /* @__PURE__ */ ((TypeFormatFlags2) => {
|
|
|
6421
6422
|
TypeFormatFlags2[TypeFormatFlags2["InElementType"] = 2097152] = "InElementType";
|
|
6422
6423
|
TypeFormatFlags2[TypeFormatFlags2["InFirstTypeArgument"] = 4194304] = "InFirstTypeArgument";
|
|
6423
6424
|
TypeFormatFlags2[TypeFormatFlags2["InTypeAlias"] = 8388608] = "InTypeAlias";
|
|
6424
|
-
TypeFormatFlags2[TypeFormatFlags2["NodeBuilderFlagsMask"] =
|
|
6425
|
+
TypeFormatFlags2[TypeFormatFlags2["NodeBuilderFlagsMask"] = 848330095] = "NodeBuilderFlagsMask";
|
|
6425
6426
|
return TypeFormatFlags2;
|
|
6426
6427
|
})(TypeFormatFlags || {});
|
|
6427
6428
|
var SymbolFormatFlags = /* @__PURE__ */ ((SymbolFormatFlags2) => {
|
|
@@ -6586,6 +6587,7 @@ var InternalSymbolName = /* @__PURE__ */ ((InternalSymbolName2) => {
|
|
|
6586
6587
|
InternalSymbolName2["ExportEquals"] = "export=";
|
|
6587
6588
|
InternalSymbolName2["Default"] = "default";
|
|
6588
6589
|
InternalSymbolName2["This"] = "this";
|
|
6590
|
+
InternalSymbolName2["InstantiationExpression"] = "__instantiationExpression";
|
|
6589
6591
|
return InternalSymbolName2;
|
|
6590
6592
|
})(InternalSymbolName || {});
|
|
6591
6593
|
var NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags2) => {
|
|
@@ -52403,7 +52405,7 @@ function createTypeChecker(host) {
|
|
|
52403
52405
|
return symbol && !!symbol.valueDeclaration && isExpression(symbol.valueDeclaration) && !isContextSensitive(symbol.valueDeclaration);
|
|
52404
52406
|
}
|
|
52405
52407
|
function toNodeBuilderFlags(flags = 0 /* None */) {
|
|
52406
|
-
return flags &
|
|
52408
|
+
return flags & 848330095 /* NodeBuilderFlagsMask */;
|
|
52407
52409
|
}
|
|
52408
52410
|
function isClassInstanceSide(type) {
|
|
52409
52411
|
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) & 16777216 /* IsClassInstanceClone */));
|
|
@@ -52652,7 +52654,7 @@ function createTypeChecker(host) {
|
|
|
52652
52654
|
}
|
|
52653
52655
|
return factory.createInferTypeNode(typeParameterToDeclarationWithConstraint(type, context, constraintNode));
|
|
52654
52656
|
}
|
|
52655
|
-
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && type.flags & 262144 /* TypeParameter */
|
|
52657
|
+
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && type.flags & 262144 /* TypeParameter */) {
|
|
52656
52658
|
const name2 = typeParameterToName(type, context);
|
|
52657
52659
|
context.approximateLength += idText(name2).length;
|
|
52658
52660
|
return factory.createTypeReferenceNode(
|
|
@@ -52863,6 +52865,21 @@ function createTypeChecker(host) {
|
|
|
52863
52865
|
const typeId = type2.id;
|
|
52864
52866
|
const symbol = type2.symbol;
|
|
52865
52867
|
if (symbol) {
|
|
52868
|
+
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
|
|
52869
|
+
if (isInstantiationExpressionType) {
|
|
52870
|
+
const instantiationExpressionType = type2;
|
|
52871
|
+
const existing = instantiationExpressionType.node;
|
|
52872
|
+
if (isTypeQueryNode(existing) && getTypeFromTypeNode(existing) === type2) {
|
|
52873
|
+
const typeNode = serializeExistingTypeNode(context, existing);
|
|
52874
|
+
if (typeNode) {
|
|
52875
|
+
return typeNode;
|
|
52876
|
+
}
|
|
52877
|
+
}
|
|
52878
|
+
if ((_a2 = context.visitedTypes) == null ? void 0 : _a2.has(typeId)) {
|
|
52879
|
+
return createElidedInformationPlaceholder(context);
|
|
52880
|
+
}
|
|
52881
|
+
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
52882
|
+
}
|
|
52866
52883
|
const isInstanceType = isClassInstanceSide(type2) ? 788968 /* Type */ : 111551 /* Value */;
|
|
52867
52884
|
if (isJSConstructor(symbol.valueDeclaration)) {
|
|
52868
52885
|
return symbolToTypeNode(symbol, context, isInstanceType);
|
|
@@ -52874,7 +52891,7 @@ function createTypeChecker(host) {
|
|
|
52874
52891
|
false
|
|
52875
52892
|
).accessibility !== 0 /* Accessible */)) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) {
|
|
52876
52893
|
return symbolToTypeNode(symbol, context, isInstanceType);
|
|
52877
|
-
} else if ((
|
|
52894
|
+
} else if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) {
|
|
52878
52895
|
const typeAlias = getTypeAliasForTypeLiteral(type2);
|
|
52879
52896
|
if (typeAlias) {
|
|
52880
52897
|
return symbolToTypeNode(typeAlias, context, 788968 /* Type */);
|
|
@@ -52885,20 +52902,6 @@ function createTypeChecker(host) {
|
|
|
52885
52902
|
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
52886
52903
|
}
|
|
52887
52904
|
} else {
|
|
52888
|
-
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
|
|
52889
|
-
if (isInstantiationExpressionType) {
|
|
52890
|
-
const instantiationExpressionType = type2;
|
|
52891
|
-
if (isTypeQueryNode(instantiationExpressionType.node)) {
|
|
52892
|
-
const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node);
|
|
52893
|
-
if (typeNode) {
|
|
52894
|
-
return typeNode;
|
|
52895
|
-
}
|
|
52896
|
-
}
|
|
52897
|
-
if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) {
|
|
52898
|
-
return createElidedInformationPlaceholder(context);
|
|
52899
|
-
}
|
|
52900
|
-
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
52901
|
-
}
|
|
52902
52905
|
return createTypeNodeFromObjectType(type2);
|
|
52903
52906
|
}
|
|
52904
52907
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
@@ -53452,36 +53455,65 @@ function createTypeChecker(host) {
|
|
|
53452
53455
|
true
|
|
53453
53456
|
)[0];
|
|
53454
53457
|
let cleanup;
|
|
53455
|
-
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) {
|
|
53456
|
-
|
|
53457
|
-
|
|
53458
|
-
|
|
53459
|
-
|
|
53460
|
-
|
|
53461
|
-
if (
|
|
53462
|
-
|
|
53463
|
-
|
|
53464
|
-
|
|
53465
|
-
|
|
53466
|
-
|
|
53467
|
-
|
|
53458
|
+
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && (some(expandedParams) || some(signature.typeParameters))) {
|
|
53459
|
+
let pushFakeScope2 = function(kind2, addAll) {
|
|
53460
|
+
Debug.assert(context.enclosingDeclaration);
|
|
53461
|
+
let existingFakeScope;
|
|
53462
|
+
if (getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration === kind2) {
|
|
53463
|
+
existingFakeScope = context.enclosingDeclaration;
|
|
53464
|
+
} else if (context.enclosingDeclaration.parent && getNodeLinks(context.enclosingDeclaration.parent).fakeScopeForSignatureDeclaration === kind2) {
|
|
53465
|
+
existingFakeScope = context.enclosingDeclaration.parent;
|
|
53466
|
+
}
|
|
53467
|
+
Debug.assertOptionalNode(existingFakeScope, isBlock);
|
|
53468
|
+
const locals = (existingFakeScope == null ? void 0 : existingFakeScope.locals) ?? createSymbolTable();
|
|
53469
|
+
let newLocals;
|
|
53470
|
+
addAll((name, symbol) => {
|
|
53471
|
+
if (!locals.has(name)) {
|
|
53472
|
+
newLocals = append(newLocals, name);
|
|
53473
|
+
locals.set(name, symbol);
|
|
53474
|
+
}
|
|
53475
|
+
});
|
|
53476
|
+
if (!newLocals)
|
|
53477
|
+
return;
|
|
53478
|
+
const oldCleanup = cleanup;
|
|
53479
|
+
function undo() {
|
|
53468
53480
|
forEach(newLocals, (s) => locals.delete(s));
|
|
53469
|
-
|
|
53470
|
-
|
|
53481
|
+
oldCleanup == null ? void 0 : oldCleanup();
|
|
53482
|
+
}
|
|
53471
53483
|
if (existingFakeScope) {
|
|
53472
|
-
cleanup =
|
|
53484
|
+
cleanup = undo;
|
|
53473
53485
|
} else {
|
|
53474
53486
|
const fakeScope = parseNodeFactory.createBlock(emptyArray);
|
|
53475
|
-
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration =
|
|
53487
|
+
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = kind2;
|
|
53476
53488
|
fakeScope.locals = locals;
|
|
53477
53489
|
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
53478
53490
|
setParent(fakeScope, saveEnclosingDeclaration);
|
|
53479
53491
|
context.enclosingDeclaration = fakeScope;
|
|
53480
53492
|
cleanup = () => {
|
|
53481
53493
|
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
53482
|
-
|
|
53494
|
+
undo();
|
|
53483
53495
|
};
|
|
53484
53496
|
}
|
|
53497
|
+
};
|
|
53498
|
+
var pushFakeScope = pushFakeScope2;
|
|
53499
|
+
pushFakeScope2(
|
|
53500
|
+
"params",
|
|
53501
|
+
(add) => {
|
|
53502
|
+
for (const param of expandedParams) {
|
|
53503
|
+
add(param.escapedName, param);
|
|
53504
|
+
}
|
|
53505
|
+
}
|
|
53506
|
+
);
|
|
53507
|
+
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
53508
|
+
pushFakeScope2(
|
|
53509
|
+
"typeParams",
|
|
53510
|
+
(add) => {
|
|
53511
|
+
for (const typeParam of signature.typeParameters ?? emptyArray) {
|
|
53512
|
+
const typeParamName = typeParameterToName(typeParam, context).escapedText;
|
|
53513
|
+
add(typeParamName, typeParam.symbol);
|
|
53514
|
+
}
|
|
53515
|
+
}
|
|
53516
|
+
);
|
|
53485
53517
|
}
|
|
53486
53518
|
}
|
|
53487
53519
|
const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 176 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
|
|
@@ -54026,7 +54058,7 @@ function createTypeChecker(host) {
|
|
|
54026
54058
|
return identifier;
|
|
54027
54059
|
}
|
|
54028
54060
|
}
|
|
54029
|
-
function
|
|
54061
|
+
function typeParameterShadowsOtherTypeParameterInScope(escapedName, context, type) {
|
|
54030
54062
|
const result = resolveName(
|
|
54031
54063
|
context.enclosingDeclaration,
|
|
54032
54064
|
escapedName,
|
|
@@ -54037,11 +54069,8 @@ function createTypeChecker(host) {
|
|
|
54037
54069
|
/*isUse*/
|
|
54038
54070
|
false
|
|
54039
54071
|
);
|
|
54040
|
-
if (result) {
|
|
54041
|
-
|
|
54042
|
-
return false;
|
|
54043
|
-
}
|
|
54044
|
-
return true;
|
|
54072
|
+
if (result && result.flags & 262144 /* TypeParameter */) {
|
|
54073
|
+
return result !== type.symbol;
|
|
54045
54074
|
}
|
|
54046
54075
|
return false;
|
|
54047
54076
|
}
|
|
@@ -54067,7 +54096,7 @@ function createTypeChecker(host) {
|
|
|
54067
54096
|
const rawtext = result.escapedText;
|
|
54068
54097
|
let i = ((_a = context.typeParameterNamesByTextNextNameCount) == null ? void 0 : _a.get(rawtext)) || 0;
|
|
54069
54098
|
let text = rawtext;
|
|
54070
|
-
while (((_b = context.typeParameterNamesByText) == null ? void 0 : _b.has(text)) ||
|
|
54099
|
+
while (((_b = context.typeParameterNamesByText) == null ? void 0 : _b.has(text)) || typeParameterShadowsOtherTypeParameterInScope(text, context, type)) {
|
|
54071
54100
|
i++;
|
|
54072
54101
|
text = `${rawtext}_${i}`;
|
|
54073
54102
|
}
|
|
@@ -54078,7 +54107,7 @@ function createTypeChecker(host) {
|
|
|
54078
54107
|
}
|
|
54079
54108
|
(context.typeParameterNamesByTextNextNameCount || (context.typeParameterNamesByTextNextNameCount = /* @__PURE__ */ new Map())).set(rawtext, i);
|
|
54080
54109
|
(context.typeParameterNames || (context.typeParameterNames = /* @__PURE__ */ new Map())).set(getTypeId(type), result);
|
|
54081
|
-
(context.typeParameterNamesByText || (context.typeParameterNamesByText = /* @__PURE__ */ new Set())).add(
|
|
54110
|
+
(context.typeParameterNamesByText || (context.typeParameterNamesByText = /* @__PURE__ */ new Set())).add(text);
|
|
54082
54111
|
}
|
|
54083
54112
|
return result;
|
|
54084
54113
|
}
|
|
@@ -54223,7 +54252,10 @@ function createTypeChecker(host) {
|
|
|
54223
54252
|
return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
|
|
54224
54253
|
}
|
|
54225
54254
|
function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
|
|
54226
|
-
|
|
54255
|
+
while (getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration) {
|
|
54256
|
+
enclosingDeclaration = enclosingDeclaration.parent;
|
|
54257
|
+
}
|
|
54258
|
+
return enclosingDeclaration;
|
|
54227
54259
|
}
|
|
54228
54260
|
function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
|
|
54229
54261
|
if (!isErrorType(type) && enclosingDeclaration) {
|
|
@@ -54303,7 +54335,7 @@ function createTypeChecker(host) {
|
|
|
54303
54335
|
}
|
|
54304
54336
|
if (isIdentifier(node)) {
|
|
54305
54337
|
const type = getDeclaredTypeOfSymbol(sym);
|
|
54306
|
-
const name = sym.flags & 262144 /* TypeParameter */
|
|
54338
|
+
const name = sym.flags & 262144 /* TypeParameter */ ? typeParameterToName(type, context) : factory.cloneNode(node);
|
|
54307
54339
|
name.symbol = sym;
|
|
54308
54340
|
return { introducesError, node: setEmitFlags(setOriginalNode(name, node), 16777216 /* NoAsciiEscaping */) };
|
|
54309
54341
|
}
|
|
@@ -59716,69 +59748,22 @@ function createTypeChecker(host) {
|
|
|
59716
59748
|
}
|
|
59717
59749
|
return emptyArray;
|
|
59718
59750
|
}
|
|
59719
|
-
function getSignaturesOfType(
|
|
59720
|
-
const
|
|
59721
|
-
|
|
59722
|
-
|
|
59723
|
-
|
|
59724
|
-
let memberName;
|
|
59725
|
-
if (everyType(reducedType, (t) => {
|
|
59726
|
-
var _a2;
|
|
59727
|
-
return !!((_a2 = t.symbol) == null ? void 0 : _a2.parent) && isArrayOrTupleSymbol(t.symbol.parent) && (!memberName ? (memberName = t.symbol.escapedName, true) : memberName === t.symbol.escapedName);
|
|
59728
|
-
})) {
|
|
59729
|
-
if (reducedType.arrayFallbackSignatures) {
|
|
59730
|
-
return reducedType.arrayFallbackSignatures;
|
|
59731
|
-
}
|
|
59732
|
-
const numTypes = reducedType.types.length;
|
|
59733
|
-
const numSigs = (_a = reducedType.types[0].symbol.declarations) == null ? void 0 : _a.length;
|
|
59734
|
-
Debug.assert(numSigs);
|
|
59735
|
-
const returnTypes = new Array(numSigs).fill(
|
|
59736
|
-
/*value*/
|
|
59737
|
-
void 0
|
|
59738
|
-
).map((_, isig) => {
|
|
59739
|
-
const rtset = /* @__PURE__ */ new Set();
|
|
59740
|
-
new Array(numTypes).fill(
|
|
59741
|
-
/*value*/
|
|
59742
|
-
void 0
|
|
59743
|
-
).forEach((_2, itype) => {
|
|
59744
|
-
const callSignatures = reducedType.types[itype].callSignatures ?? getSignaturesOfStructuredType(reducedType.types[itype], 0 /* Call */);
|
|
59745
|
-
if (callSignatures[isig].typeParameters)
|
|
59746
|
-
return;
|
|
59747
|
-
const returnType = callSignatures[isig].resolvedReturnType ?? getReturnTypeOfSignature(callSignatures[isig]);
|
|
59748
|
-
Debug.assert(returnType);
|
|
59749
|
-
rtset.add(returnType);
|
|
59750
|
-
});
|
|
59751
|
-
const art = [];
|
|
59752
|
-
rtset.forEach((rt) => art.push(rt));
|
|
59753
|
-
if (art.length === 0)
|
|
59754
|
-
return void 0;
|
|
59755
|
-
if (art.length === 1)
|
|
59756
|
-
return art[0];
|
|
59757
|
-
return getUnionType(art, 2 /* Subtype */);
|
|
59758
|
-
});
|
|
59759
|
-
const arrayArg = mapType(reducedType, (t) => getMappedType((isReadonlyArraySymbol(t.symbol.parent) ? globalReadonlyArrayType : globalArrayType).typeParameters[0], t.mapper));
|
|
59760
|
-
const arrayType = createArrayType(arrayArg, someType(reducedType, (t) => isReadonlyArraySymbol(t.symbol.parent)));
|
|
59761
|
-
const result2 = getSignaturesOfType(getTypeOfPropertyOfType(arrayType, memberName), kind);
|
|
59762
|
-
returnTypes.forEach((returnType, sigidx) => {
|
|
59763
|
-
if (returnType)
|
|
59764
|
-
result2[sigidx].resolvedReturnType = returnTypes[sigidx];
|
|
59765
|
-
});
|
|
59766
|
-
return reducedType.arrayFallbackSignatures = result2;
|
|
59767
|
-
}
|
|
59751
|
+
function getSignaturesOfType(type, kind) {
|
|
59752
|
+
const result = getSignaturesOfStructuredType(getReducedApparentType(type), kind);
|
|
59753
|
+
if (kind === 0 /* Call */ && !length(result) && type.flags & 1048576 /* Union */) {
|
|
59754
|
+
if (type.arrayFallbackSignatures) {
|
|
59755
|
+
return type.arrayFallbackSignatures;
|
|
59768
59756
|
}
|
|
59769
|
-
|
|
59770
|
-
|
|
59771
|
-
|
|
59772
|
-
|
|
59773
|
-
|
|
59774
|
-
|
|
59775
|
-
|
|
59776
|
-
return
|
|
59757
|
+
let memberName;
|
|
59758
|
+
if (everyType(type, (t) => {
|
|
59759
|
+
var _a;
|
|
59760
|
+
return !!((_a = t.symbol) == null ? void 0 : _a.parent) && isArrayOrTupleSymbol(t.symbol.parent) && (!memberName ? (memberName = t.symbol.escapedName, true) : memberName === t.symbol.escapedName);
|
|
59761
|
+
})) {
|
|
59762
|
+
const arrayArg = mapType(type, (t) => getMappedType((isReadonlyArraySymbol(t.symbol.parent) ? globalReadonlyArrayType : globalArrayType).typeParameters[0], t.mapper));
|
|
59763
|
+
const arrayType = createArrayType(arrayArg, someType(type, (t) => isReadonlyArraySymbol(t.symbol.parent)));
|
|
59764
|
+
return type.arrayFallbackSignatures = getSignaturesOfType(getTypeOfPropertyOfType(arrayType, memberName), kind);
|
|
59777
59765
|
}
|
|
59778
|
-
|
|
59779
|
-
result = getSignaturesOfStructuredType(reducedType, kind);
|
|
59780
|
-
if (kind === 0 /* Call */ && reducedType.flags & 1048576 /* Union */) {
|
|
59781
|
-
reducedType.arrayFallbackSignatures = result;
|
|
59766
|
+
type.arrayFallbackSignatures = result;
|
|
59782
59767
|
}
|
|
59783
59768
|
return result;
|
|
59784
59769
|
}
|
|
@@ -63824,6 +63809,7 @@ function createTypeChecker(host) {
|
|
|
63824
63809
|
) : strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType;
|
|
63825
63810
|
}
|
|
63826
63811
|
function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
63812
|
+
Debug.assert(type.symbol, "anonymous type must have symbol to be instantiated");
|
|
63827
63813
|
const result = createObjectType(type.objectFlags & ~(524288 /* CouldContainTypeVariablesComputed */ | 1048576 /* CouldContainTypeVariables */) | 64 /* Instantiated */, type.symbol);
|
|
63828
63814
|
if (type.objectFlags & 32 /* Mapped */) {
|
|
63829
63815
|
result.declaration = type.declaration;
|
|
@@ -67071,6 +67057,7 @@ function createTypeChecker(host) {
|
|
|
67071
67057
|
const sourceObjectFlags = getObjectFlags(source2);
|
|
67072
67058
|
const targetObjectFlags = getObjectFlags(target2);
|
|
67073
67059
|
if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source2.symbol === target2.symbol || sourceObjectFlags & 4 /* Reference */ && targetObjectFlags & 4 /* Reference */ && source2.target === target2.target) {
|
|
67060
|
+
Debug.assertEqual(sourceSignatures.length, targetSignatures.length);
|
|
67074
67061
|
for (let i = 0; i < targetSignatures.length; i++) {
|
|
67075
67062
|
const related = signatureRelatedTo(
|
|
67076
67063
|
sourceSignatures[i],
|
|
@@ -70364,6 +70351,10 @@ function createTypeChecker(host) {
|
|
|
70364
70351
|
case 211 /* PropertyAccessExpression */:
|
|
70365
70352
|
case 212 /* ElementAccessExpression */:
|
|
70366
70353
|
return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol);
|
|
70354
|
+
case 206 /* ObjectBindingPattern */:
|
|
70355
|
+
case 207 /* ArrayBindingPattern */:
|
|
70356
|
+
const rootDeclaration = getRootDeclaration(node.parent);
|
|
70357
|
+
return isVariableDeclaration(rootDeclaration) && isVarConstLike(rootDeclaration);
|
|
70367
70358
|
}
|
|
70368
70359
|
return false;
|
|
70369
70360
|
}
|
|
@@ -71281,6 +71272,9 @@ function createTypeChecker(host) {
|
|
|
71281
71272
|
}
|
|
71282
71273
|
function getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived) {
|
|
71283
71274
|
if (!assumeTrue) {
|
|
71275
|
+
if (type === candidate) {
|
|
71276
|
+
return neverType;
|
|
71277
|
+
}
|
|
71284
71278
|
if (checkDerived) {
|
|
71285
71279
|
return filterType(type, (t) => !isTypeDerivedFrom(t, candidate));
|
|
71286
71280
|
}
|
|
@@ -71297,6 +71291,9 @@ function createTypeChecker(host) {
|
|
|
71297
71291
|
if (type.flags & 3 /* AnyOrUnknown */) {
|
|
71298
71292
|
return candidate;
|
|
71299
71293
|
}
|
|
71294
|
+
if (type === candidate) {
|
|
71295
|
+
return candidate;
|
|
71296
|
+
}
|
|
71300
71297
|
const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf;
|
|
71301
71298
|
const keyPropertyName = type.flags & 1048576 /* Union */ ? getKeyPropertyName(type) : void 0;
|
|
71302
71299
|
const narrowedType = mapType(candidate, (c) => {
|
|
@@ -77322,14 +77319,7 @@ function createTypeChecker(host) {
|
|
|
77322
77319
|
hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
|
|
77323
77320
|
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
77324
77321
|
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
77325
|
-
const result3 = createAnonymousType(
|
|
77326
|
-
/*symbol*/
|
|
77327
|
-
void 0,
|
|
77328
|
-
resolved.members,
|
|
77329
|
-
callSignatures,
|
|
77330
|
-
constructSignatures,
|
|
77331
|
-
resolved.indexInfos
|
|
77332
|
-
);
|
|
77322
|
+
const result3 = createAnonymousType(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
|
|
77333
77323
|
result3.objectFlags |= 8388608 /* InstantiationExpressionType */;
|
|
77334
77324
|
result3.node = node;
|
|
77335
77325
|
return result3;
|
|
@@ -145056,6 +145046,13 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
145056
145046
|
return sourceFile;
|
|
145057
145047
|
}
|
|
145058
145048
|
function synchronizeHostData() {
|
|
145049
|
+
if (host.updateFromProject && !host.updateFromProjectInProgress) {
|
|
145050
|
+
host.updateFromProject();
|
|
145051
|
+
} else {
|
|
145052
|
+
synchronizeHostDataWorker();
|
|
145053
|
+
}
|
|
145054
|
+
}
|
|
145055
|
+
function synchronizeHostDataWorker() {
|
|
145059
145056
|
var _a2, _b, _c;
|
|
145060
145057
|
Debug.assert(languageServiceMode !== 2 /* Syntactic */);
|
|
145061
145058
|
if (host.getProjectVersion) {
|
|
@@ -150319,7 +150316,17 @@ var errorCodes18 = [
|
|
|
150319
150316
|
Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code,
|
|
150320
150317
|
Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here.code,
|
|
150321
150318
|
Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code,
|
|
150322
|
-
Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code
|
|
150319
|
+
Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code,
|
|
150320
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery.code,
|
|
150321
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later.code,
|
|
150322
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom.code,
|
|
150323
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig.code,
|
|
150324
|
+
Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code,
|
|
150325
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig.code,
|
|
150326
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha.code,
|
|
150327
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode.code,
|
|
150328
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig.code,
|
|
150329
|
+
Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code
|
|
150323
150330
|
];
|
|
150324
150331
|
registerCodeFix({
|
|
150325
150332
|
errorCodes: errorCodes18,
|
|
@@ -175413,6 +175420,35 @@ var TypingsInstaller = class {
|
|
|
175413
175420
|
}
|
|
175414
175421
|
}
|
|
175415
175422
|
}
|
|
175423
|
+
/** @internal */
|
|
175424
|
+
installPackage(req) {
|
|
175425
|
+
const { fileName, packageName, projectName, projectRootPath } = req;
|
|
175426
|
+
const cwd = forEachAncestorDirectory(getDirectoryPath(fileName), (directory) => {
|
|
175427
|
+
if (this.installTypingHost.fileExists(combinePaths(directory, "package.json"))) {
|
|
175428
|
+
return directory;
|
|
175429
|
+
}
|
|
175430
|
+
}) || projectRootPath;
|
|
175431
|
+
if (cwd) {
|
|
175432
|
+
this.installWorker(-1, [packageName], cwd, (success) => {
|
|
175433
|
+
const message = success ? `Package ${packageName} installed.` : `There was an error installing ${packageName}.`;
|
|
175434
|
+
const response = {
|
|
175435
|
+
kind: ActionPackageInstalled,
|
|
175436
|
+
projectName,
|
|
175437
|
+
success,
|
|
175438
|
+
message
|
|
175439
|
+
};
|
|
175440
|
+
this.sendResponse(response);
|
|
175441
|
+
});
|
|
175442
|
+
} else {
|
|
175443
|
+
const response = {
|
|
175444
|
+
kind: ActionPackageInstalled,
|
|
175445
|
+
projectName,
|
|
175446
|
+
success: false,
|
|
175447
|
+
message: "Could not determine a project root path."
|
|
175448
|
+
};
|
|
175449
|
+
this.sendResponse(response);
|
|
175450
|
+
}
|
|
175451
|
+
}
|
|
175416
175452
|
initializeSafeList() {
|
|
175417
175453
|
if (this.typesMapLocation) {
|
|
175418
175454
|
const safeListFromMap = ts_JsTyping_exports.loadTypesMap(this.installTypingHost, this.typesMapLocation);
|
|
@@ -176788,6 +176824,8 @@ var Project3 = class _Project {
|
|
|
176788
176824
|
this.createHash = maybeBind(this.projectService.host, this.projectService.host.createHash);
|
|
176789
176825
|
/** @internal */
|
|
176790
176826
|
this.globalCacheResolutionModuleName = ts_JsTyping_exports.nonRelativeModuleNameForTypingCache;
|
|
176827
|
+
/** @internal */
|
|
176828
|
+
this.updateFromProjectInProgress = false;
|
|
176791
176829
|
this.projectName = projectName;
|
|
176792
176830
|
this.directoryStructureHost = directoryStructureHost;
|
|
176793
176831
|
this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory);
|
|
@@ -177532,6 +177570,10 @@ var Project3 = class _Project {
|
|
|
177532
177570
|
onDiscoveredSymlink() {
|
|
177533
177571
|
this.hasAddedOrRemovedSymlinks = true;
|
|
177534
177572
|
}
|
|
177573
|
+
/** @internal */
|
|
177574
|
+
updateFromProject() {
|
|
177575
|
+
updateProjectIfDirty(this);
|
|
177576
|
+
}
|
|
177535
177577
|
/**
|
|
177536
177578
|
* Updates set of files that contribute to this project
|
|
177537
177579
|
* @returns: true if set of files in the project stays the same and false - otherwise.
|
|
@@ -177549,7 +177591,7 @@ var Project3 = class _Project {
|
|
|
177549
177591
|
for (const file of changedFiles) {
|
|
177550
177592
|
this.cachedUnresolvedImportsPerFile.delete(file);
|
|
177551
177593
|
}
|
|
177552
|
-
if (this.languageServiceEnabled && this.projectService.serverMode === 0 /* Semantic */) {
|
|
177594
|
+
if (this.languageServiceEnabled && this.projectService.serverMode === 0 /* Semantic */ && !this.isOrphan()) {
|
|
177553
177595
|
if (hasNewProgram || changedFiles.length) {
|
|
177554
177596
|
this.lastCachedUnresolvedImportsList = getUnresolvedImports(this.program, this.cachedUnresolvedImportsPerFile);
|
|
177555
177597
|
}
|
|
@@ -177690,8 +177732,10 @@ var Project3 = class _Project {
|
|
|
177690
177732
|
this.hasInvalidatedResolutions = hasInvalidatedResolutions;
|
|
177691
177733
|
this.hasInvalidatedLibResolutions = hasInvalidatedLibResolutions;
|
|
177692
177734
|
this.resolutionCache.startCachingPerDirectoryResolution();
|
|
177693
|
-
this.program = this.languageService.getProgram();
|
|
177694
177735
|
this.dirty = false;
|
|
177736
|
+
this.updateFromProjectInProgress = true;
|
|
177737
|
+
this.program = this.languageService.getProgram();
|
|
177738
|
+
this.updateFromProjectInProgress = false;
|
|
177695
177739
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "finishCachingPerDirectoryResolution");
|
|
177696
177740
|
this.resolutionCache.finishCachingPerDirectoryResolution(this.program, oldProgram);
|
|
177697
177741
|
(_b = tracing) == null ? void 0 : _b.pop();
|
|
@@ -183807,9 +183851,10 @@ var Session3 = class _Session {
|
|
|
183807
183851
|
}
|
|
183808
183852
|
}
|
|
183809
183853
|
projectsUpdatedInBackgroundEvent(openFiles) {
|
|
183810
|
-
this.projectService.logger.info(`got projects updated in background
|
|
183854
|
+
this.projectService.logger.info(`got projects updated in background ${openFiles}`);
|
|
183811
183855
|
if (openFiles.length) {
|
|
183812
183856
|
if (!this.suppressDiagnosticEvents && !this.noGetErrOnBackgroundUpdate) {
|
|
183857
|
+
this.projectService.logger.info(`Queueing diagnostics update for ${openFiles}`);
|
|
183813
183858
|
this.errorCheck.startNew((next) => this.updateErrorCheck(
|
|
183814
183859
|
next,
|
|
183815
183860
|
openFiles,
|
|
@@ -183880,7 +183925,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
183880
183925
|
send(msg) {
|
|
183881
183926
|
if (msg.type === "event" && !this.canUseEvents) {
|
|
183882
183927
|
if (this.logger.hasLevel(3 /* verbose */)) {
|
|
183883
|
-
this.logger.info(`Session does not support events: ignored event: ${
|
|
183928
|
+
this.logger.info(`Session does not support events: ignored event: ${stringifyIndented(msg)}`);
|
|
183884
183929
|
}
|
|
183885
183930
|
return;
|
|
183886
183931
|
}
|
package/lib/typescript.d.ts
CHANGED
|
@@ -6887,6 +6887,7 @@ declare namespace ts {
|
|
|
6887
6887
|
None = 0,
|
|
6888
6888
|
NoTruncation = 1,
|
|
6889
6889
|
WriteArrayAsGenericType = 2,
|
|
6890
|
+
GenerateNamesForShadowedTypeParams = 4,
|
|
6890
6891
|
UseStructuralFallback = 8,
|
|
6891
6892
|
WriteTypeArgumentsOfSignature = 32,
|
|
6892
6893
|
UseFullyQualifiedType = 64,
|
|
@@ -6906,7 +6907,7 @@ declare namespace ts {
|
|
|
6906
6907
|
InElementType = 2097152,
|
|
6907
6908
|
InFirstTypeArgument = 4194304,
|
|
6908
6909
|
InTypeAlias = 8388608,
|
|
6909
|
-
NodeBuilderFlagsMask =
|
|
6910
|
+
NodeBuilderFlagsMask = 848330095,
|
|
6910
6911
|
}
|
|
6911
6912
|
enum SymbolFormatFlags {
|
|
6912
6913
|
None = 0,
|
|
@@ -7048,6 +7049,7 @@ declare namespace ts {
|
|
|
7048
7049
|
ExportEquals = "export=",
|
|
7049
7050
|
Default = "default",
|
|
7050
7051
|
This = "this",
|
|
7052
|
+
InstantiationExpression = "__instantiationExpression",
|
|
7051
7053
|
}
|
|
7052
7054
|
/**
|
|
7053
7055
|
* This represents a string whose leading underscore have been escaped by adding extra leading underscores.
|