@typescript-deploys/pr-build 5.4.0-pr-56357-10 → 5.4.0-pr-55061-8
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 +0 -46
- package/lib/tsserver.js +5 -47
- package/lib/typescript.js +5 -47
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -71263,11 +71263,6 @@ function createTypeChecker(host) {
|
|
|
71263
71263
|
result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
|
|
71264
71264
|
}
|
|
71265
71265
|
if (result) {
|
|
71266
|
-
const returnType = calculateSignatureReturnTypeForSpecialCases(result, args);
|
|
71267
|
-
if (returnType) {
|
|
71268
|
-
result = cloneSignature(result);
|
|
71269
|
-
result.resolvedReturnType = returnType;
|
|
71270
|
-
}
|
|
71271
71266
|
return result;
|
|
71272
71267
|
}
|
|
71273
71268
|
result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode);
|
|
@@ -71385,47 +71380,6 @@ function createTypeChecker(host) {
|
|
|
71385
71380
|
}
|
|
71386
71381
|
}
|
|
71387
71382
|
return result;
|
|
71388
|
-
function calculateSignatureReturnTypeForSpecialCases(signature, args2) {
|
|
71389
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
71390
|
-
if (args2.length >= 1) {
|
|
71391
|
-
if (((_b = (_a = signature.declaration) == null ? void 0 : _a.symbol) == null ? void 0 : _b.escapedName) === "filter" && (((_e = (_d = (_c = signature.declaration) == null ? void 0 : _c.symbol) == null ? void 0 : _d.parent) == null ? void 0 : _e.escapedName) === "Array" || ((_h = (_g = (_f = signature.declaration) == null ? void 0 : _f.symbol) == null ? void 0 : _g.parent) == null ? void 0 : _h.escapedName) === "ReadonlyArray")) {
|
|
71392
|
-
const arg0Type = getTypeOfExpression(args2[0]);
|
|
71393
|
-
if (((_i = arg0Type.symbol) == null ? void 0 : _i.escapedName) === "BooleanConstructor") {
|
|
71394
|
-
let returnType = (_j = signature.mapper) == null ? void 0 : _j.targets[1];
|
|
71395
|
-
if (returnType) {
|
|
71396
|
-
const nonFalsieArrayTypesOut = [];
|
|
71397
|
-
forEachType(returnType, (at) => {
|
|
71398
|
-
let elemType;
|
|
71399
|
-
if (isTupleType(at)) {
|
|
71400
|
-
elemType = getUnionType(getElementTypes(at));
|
|
71401
|
-
} else if (isTupleLikeType(at)) {
|
|
71402
|
-
nonFalsieArrayTypesOut.push(at);
|
|
71403
|
-
return;
|
|
71404
|
-
} else {
|
|
71405
|
-
elemType = getElementTypeOfArrayType(at) || anyType;
|
|
71406
|
-
}
|
|
71407
|
-
const nonFalsieElemTypes = [];
|
|
71408
|
-
nonFalsieElemTypes.push(filterType(
|
|
71409
|
-
elemType,
|
|
71410
|
-
(t) => {
|
|
71411
|
-
const facts = getTypeFacts(t, 4194304 /* Truthy */ | 8388608 /* Falsy */);
|
|
71412
|
-
if (facts === 8388608 /* Falsy */) {
|
|
71413
|
-
return false;
|
|
71414
|
-
} else {
|
|
71415
|
-
return true;
|
|
71416
|
-
}
|
|
71417
|
-
}
|
|
71418
|
-
));
|
|
71419
|
-
const atout = createArrayType(getUnionType(nonFalsieElemTypes));
|
|
71420
|
-
nonFalsieArrayTypesOut.push(atout);
|
|
71421
|
-
});
|
|
71422
|
-
returnType = getUnionType(nonFalsieArrayTypesOut);
|
|
71423
|
-
return returnType;
|
|
71424
|
-
}
|
|
71425
|
-
}
|
|
71426
|
-
}
|
|
71427
|
-
}
|
|
71428
|
-
}
|
|
71429
71383
|
function addImplementationSuccessElaboration(failed, diagnostic) {
|
|
71430
71384
|
var _a, _b;
|
|
71431
71385
|
const oldCandidatesForArgumentError = candidatesForArgumentError;
|
package/lib/tsserver.js
CHANGED
|
@@ -75971,11 +75971,6 @@ function createTypeChecker(host) {
|
|
|
75971
75971
|
result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
|
|
75972
75972
|
}
|
|
75973
75973
|
if (result) {
|
|
75974
|
-
const returnType = calculateSignatureReturnTypeForSpecialCases(result, args);
|
|
75975
|
-
if (returnType) {
|
|
75976
|
-
result = cloneSignature(result);
|
|
75977
|
-
result.resolvedReturnType = returnType;
|
|
75978
|
-
}
|
|
75979
75974
|
return result;
|
|
75980
75975
|
}
|
|
75981
75976
|
result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode);
|
|
@@ -76093,47 +76088,6 @@ function createTypeChecker(host) {
|
|
|
76093
76088
|
}
|
|
76094
76089
|
}
|
|
76095
76090
|
return result;
|
|
76096
|
-
function calculateSignatureReturnTypeForSpecialCases(signature, args2) {
|
|
76097
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
76098
|
-
if (args2.length >= 1) {
|
|
76099
|
-
if (((_b = (_a = signature.declaration) == null ? void 0 : _a.symbol) == null ? void 0 : _b.escapedName) === "filter" && (((_e = (_d = (_c = signature.declaration) == null ? void 0 : _c.symbol) == null ? void 0 : _d.parent) == null ? void 0 : _e.escapedName) === "Array" || ((_h = (_g = (_f = signature.declaration) == null ? void 0 : _f.symbol) == null ? void 0 : _g.parent) == null ? void 0 : _h.escapedName) === "ReadonlyArray")) {
|
|
76100
|
-
const arg0Type = getTypeOfExpression(args2[0]);
|
|
76101
|
-
if (((_i = arg0Type.symbol) == null ? void 0 : _i.escapedName) === "BooleanConstructor") {
|
|
76102
|
-
let returnType = (_j = signature.mapper) == null ? void 0 : _j.targets[1];
|
|
76103
|
-
if (returnType) {
|
|
76104
|
-
const nonFalsieArrayTypesOut = [];
|
|
76105
|
-
forEachType(returnType, (at) => {
|
|
76106
|
-
let elemType;
|
|
76107
|
-
if (isTupleType(at)) {
|
|
76108
|
-
elemType = getUnionType(getElementTypes(at));
|
|
76109
|
-
} else if (isTupleLikeType(at)) {
|
|
76110
|
-
nonFalsieArrayTypesOut.push(at);
|
|
76111
|
-
return;
|
|
76112
|
-
} else {
|
|
76113
|
-
elemType = getElementTypeOfArrayType(at) || anyType;
|
|
76114
|
-
}
|
|
76115
|
-
const nonFalsieElemTypes = [];
|
|
76116
|
-
nonFalsieElemTypes.push(filterType(
|
|
76117
|
-
elemType,
|
|
76118
|
-
(t) => {
|
|
76119
|
-
const facts = getTypeFacts(t, 4194304 /* Truthy */ | 8388608 /* Falsy */);
|
|
76120
|
-
if (facts === 8388608 /* Falsy */) {
|
|
76121
|
-
return false;
|
|
76122
|
-
} else {
|
|
76123
|
-
return true;
|
|
76124
|
-
}
|
|
76125
|
-
}
|
|
76126
|
-
));
|
|
76127
|
-
const atout = createArrayType(getUnionType(nonFalsieElemTypes));
|
|
76128
|
-
nonFalsieArrayTypesOut.push(atout);
|
|
76129
|
-
});
|
|
76130
|
-
returnType = getUnionType(nonFalsieArrayTypesOut);
|
|
76131
|
-
return returnType;
|
|
76132
|
-
}
|
|
76133
|
-
}
|
|
76134
|
-
}
|
|
76135
|
-
}
|
|
76136
|
-
}
|
|
76137
76091
|
function addImplementationSuccessElaboration(failed, diagnostic) {
|
|
76138
76092
|
var _a, _b;
|
|
76139
76093
|
const oldCandidatesForArgumentError = candidatesForArgumentError;
|
|
@@ -160090,9 +160044,13 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
160090
160044
|
}
|
|
160091
160045
|
return scope;
|
|
160092
160046
|
}
|
|
160047
|
+
function isInDifferentLineWithContextToken(contextToken2, position2) {
|
|
160048
|
+
return sourceFile.getLineEndOfPosition(contextToken2.getEnd()) < position2;
|
|
160049
|
+
}
|
|
160093
160050
|
function isCompletionListBlocker(contextToken2) {
|
|
160094
160051
|
const start3 = timestamp();
|
|
160095
|
-
const result = isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) ||
|
|
160052
|
+
const result = isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) || // GH#54729 ignore this case when current position is in a newline
|
|
160053
|
+
isSolelyIdentifierDefinitionLocation(contextToken2) && !isInDifferentLineWithContextToken(contextToken2, position) || isDotOfNumericLiteral(contextToken2) || isInJsxText(contextToken2) || isBigIntLiteral(contextToken2);
|
|
160096
160054
|
log("getCompletionsAtPosition: isCompletionListBlocker: " + (timestamp() - start3));
|
|
160097
160055
|
return result;
|
|
160098
160056
|
}
|
package/lib/typescript.js
CHANGED
|
@@ -73736,11 +73736,6 @@ ${lanes.join("\n")}
|
|
|
73736
73736
|
result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
|
|
73737
73737
|
}
|
|
73738
73738
|
if (result) {
|
|
73739
|
-
const returnType = calculateSignatureReturnTypeForSpecialCases(result, args);
|
|
73740
|
-
if (returnType) {
|
|
73741
|
-
result = cloneSignature(result);
|
|
73742
|
-
result.resolvedReturnType = returnType;
|
|
73743
|
-
}
|
|
73744
73739
|
return result;
|
|
73745
73740
|
}
|
|
73746
73741
|
result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode);
|
|
@@ -73858,47 +73853,6 @@ ${lanes.join("\n")}
|
|
|
73858
73853
|
}
|
|
73859
73854
|
}
|
|
73860
73855
|
return result;
|
|
73861
|
-
function calculateSignatureReturnTypeForSpecialCases(signature, args2) {
|
|
73862
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
73863
|
-
if (args2.length >= 1) {
|
|
73864
|
-
if (((_b = (_a = signature.declaration) == null ? void 0 : _a.symbol) == null ? void 0 : _b.escapedName) === "filter" && (((_e = (_d = (_c = signature.declaration) == null ? void 0 : _c.symbol) == null ? void 0 : _d.parent) == null ? void 0 : _e.escapedName) === "Array" || ((_h = (_g = (_f = signature.declaration) == null ? void 0 : _f.symbol) == null ? void 0 : _g.parent) == null ? void 0 : _h.escapedName) === "ReadonlyArray")) {
|
|
73865
|
-
const arg0Type = getTypeOfExpression(args2[0]);
|
|
73866
|
-
if (((_i = arg0Type.symbol) == null ? void 0 : _i.escapedName) === "BooleanConstructor") {
|
|
73867
|
-
let returnType = (_j = signature.mapper) == null ? void 0 : _j.targets[1];
|
|
73868
|
-
if (returnType) {
|
|
73869
|
-
const nonFalsieArrayTypesOut = [];
|
|
73870
|
-
forEachType(returnType, (at) => {
|
|
73871
|
-
let elemType;
|
|
73872
|
-
if (isTupleType(at)) {
|
|
73873
|
-
elemType = getUnionType(getElementTypes(at));
|
|
73874
|
-
} else if (isTupleLikeType(at)) {
|
|
73875
|
-
nonFalsieArrayTypesOut.push(at);
|
|
73876
|
-
return;
|
|
73877
|
-
} else {
|
|
73878
|
-
elemType = getElementTypeOfArrayType(at) || anyType;
|
|
73879
|
-
}
|
|
73880
|
-
const nonFalsieElemTypes = [];
|
|
73881
|
-
nonFalsieElemTypes.push(filterType(
|
|
73882
|
-
elemType,
|
|
73883
|
-
(t) => {
|
|
73884
|
-
const facts = getTypeFacts(t, 4194304 /* Truthy */ | 8388608 /* Falsy */);
|
|
73885
|
-
if (facts === 8388608 /* Falsy */) {
|
|
73886
|
-
return false;
|
|
73887
|
-
} else {
|
|
73888
|
-
return true;
|
|
73889
|
-
}
|
|
73890
|
-
}
|
|
73891
|
-
));
|
|
73892
|
-
const atout = createArrayType(getUnionType(nonFalsieElemTypes));
|
|
73893
|
-
nonFalsieArrayTypesOut.push(atout);
|
|
73894
|
-
});
|
|
73895
|
-
returnType = getUnionType(nonFalsieArrayTypesOut);
|
|
73896
|
-
return returnType;
|
|
73897
|
-
}
|
|
73898
|
-
}
|
|
73899
|
-
}
|
|
73900
|
-
}
|
|
73901
|
-
}
|
|
73902
73856
|
function addImplementationSuccessElaboration(failed, diagnostic) {
|
|
73903
73857
|
var _a, _b;
|
|
73904
73858
|
const oldCandidatesForArgumentError = candidatesForArgumentError;
|
|
@@ -159304,9 +159258,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159304
159258
|
}
|
|
159305
159259
|
return scope;
|
|
159306
159260
|
}
|
|
159261
|
+
function isInDifferentLineWithContextToken(contextToken2, position2) {
|
|
159262
|
+
return sourceFile.getLineEndOfPosition(contextToken2.getEnd()) < position2;
|
|
159263
|
+
}
|
|
159307
159264
|
function isCompletionListBlocker(contextToken2) {
|
|
159308
159265
|
const start2 = timestamp();
|
|
159309
|
-
const result = isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) ||
|
|
159266
|
+
const result = isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) || // GH#54729 ignore this case when current position is in a newline
|
|
159267
|
+
isSolelyIdentifierDefinitionLocation(contextToken2) && !isInDifferentLineWithContextToken(contextToken2, position) || isDotOfNumericLiteral(contextToken2) || isInJsxText(contextToken2) || isBigIntLiteral(contextToken2);
|
|
159310
159268
|
log("getCompletionsAtPosition: isCompletionListBlocker: " + (timestamp() - start2));
|
|
159311
159269
|
return result;
|
|
159312
159270
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.4.0-pr-
|
|
5
|
+
"version": "5.4.0-pr-55061-8",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"node": "20.1.0",
|
|
116
116
|
"npm": "8.19.4"
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "7d6ad0a046f626292c3f7837023619b421f7b199"
|
|
119
119
|
}
|