typescript 4.7.0-dev.20220316 → 4.7.0-dev.20220317
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 +18 -8
- package/lib/tsserver.js +39 -22
- package/lib/tsserverlibrary.js +39 -22
- package/lib/typescript.js +39 -22
- package/lib/typescriptServices.js +39 -22
- package/lib/typingsInstaller.js +24 -9
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.7";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220317";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -48751,7 +48751,15 @@ var ts;
|
|
|
48751
48751
|
return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined;
|
|
48752
48752
|
});
|
|
48753
48753
|
var syntheticArgsSymbol = createSymbol(3, "args", 32768);
|
|
48754
|
-
|
|
48754
|
+
if (lastParamVariadicType) {
|
|
48755
|
+
syntheticArgsSymbol.type = createArrayType(getTypeFromTypeNode(lastParamVariadicType.type));
|
|
48756
|
+
}
|
|
48757
|
+
else {
|
|
48758
|
+
syntheticArgsSymbol.checkFlags |= 65536;
|
|
48759
|
+
syntheticArgsSymbol.deferralParent = neverType;
|
|
48760
|
+
syntheticArgsSymbol.deferralConstituents = [anyArrayType];
|
|
48761
|
+
syntheticArgsSymbol.deferralWriteConstituents = [anyArrayType];
|
|
48762
|
+
}
|
|
48755
48763
|
if (lastParamVariadicType) {
|
|
48756
48764
|
parameters.pop();
|
|
48757
48765
|
}
|
|
@@ -64247,7 +64255,9 @@ var ts;
|
|
|
64247
64255
|
}
|
|
64248
64256
|
if (signatureHasRestParameter(signature)) {
|
|
64249
64257
|
var parameter = ts.last(signature.parameters);
|
|
64250
|
-
if (
|
|
64258
|
+
if (parameter.valueDeclaration
|
|
64259
|
+
? !ts.getEffectiveTypeAnnotationNode(parameter.valueDeclaration)
|
|
64260
|
+
: !!(ts.getCheckFlags(parameter) & 65536)) {
|
|
64251
64261
|
var contextualParameterType = getRestTypeAtPosition(context, len);
|
|
64252
64262
|
assignParameterType(parameter, contextualParameterType);
|
|
64253
64263
|
}
|
|
@@ -64266,8 +64276,8 @@ var ts;
|
|
|
64266
64276
|
var links = getSymbolLinks(parameter);
|
|
64267
64277
|
if (!links.type) {
|
|
64268
64278
|
var declaration = parameter.valueDeclaration;
|
|
64269
|
-
links.type = type || getWidenedTypeForVariableLikeDeclaration(declaration, true);
|
|
64270
|
-
if (declaration.name.kind !== 79) {
|
|
64279
|
+
links.type = type || (declaration ? getWidenedTypeForVariableLikeDeclaration(declaration, true) : getTypeOfSymbol(parameter));
|
|
64280
|
+
if (declaration && declaration.name.kind !== 79) {
|
|
64271
64281
|
if (links.type === unknownType) {
|
|
64272
64282
|
links.type = getTypeFromBindingPattern(declaration.name);
|
|
64273
64283
|
}
|
|
@@ -73546,9 +73556,9 @@ var ts;
|
|
|
73546
73556
|
}
|
|
73547
73557
|
var parent = ts.walkUpParenthesizedTypes(node.parent);
|
|
73548
73558
|
if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) {
|
|
73549
|
-
|
|
73550
|
-
if (
|
|
73551
|
-
parent =
|
|
73559
|
+
var host_2 = ts.getJSDocHost(parent);
|
|
73560
|
+
if (host_2) {
|
|
73561
|
+
parent = ts.getSingleVariableOfVariableStatement(host_2) || host_2;
|
|
73552
73562
|
}
|
|
73553
73563
|
}
|
|
73554
73564
|
switch (parent.kind) {
|
package/lib/tsserver.js
CHANGED
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
103
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220317";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -58896,7 +58896,19 @@ var ts;
|
|
|
58896
58896
|
return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined;
|
|
58897
58897
|
});
|
|
58898
58898
|
var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args", 32768 /* RestParameter */);
|
|
58899
|
-
|
|
58899
|
+
if (lastParamVariadicType) {
|
|
58900
|
+
// Parameter has effective annotation, lock in type
|
|
58901
|
+
syntheticArgsSymbol.type = createArrayType(getTypeFromTypeNode(lastParamVariadicType.type));
|
|
58902
|
+
}
|
|
58903
|
+
else {
|
|
58904
|
+
// Parameter has no annotation
|
|
58905
|
+
// By using a `DeferredType` symbol, we allow the type of this rest arg to be overriden by contextual type assignment so long as its type hasn't been
|
|
58906
|
+
// cached by `getTypeOfSymbol` yet.
|
|
58907
|
+
syntheticArgsSymbol.checkFlags |= 65536 /* DeferredType */;
|
|
58908
|
+
syntheticArgsSymbol.deferralParent = neverType;
|
|
58909
|
+
syntheticArgsSymbol.deferralConstituents = [anyArrayType];
|
|
58910
|
+
syntheticArgsSymbol.deferralWriteConstituents = [anyArrayType];
|
|
58911
|
+
}
|
|
58900
58912
|
if (lastParamVariadicType) {
|
|
58901
58913
|
// Replace the last parameter with a rest parameter.
|
|
58902
58914
|
parameters.pop();
|
|
@@ -76783,7 +76795,11 @@ var ts;
|
|
|
76783
76795
|
if (signatureHasRestParameter(signature)) {
|
|
76784
76796
|
// parameter might be a transient symbol generated by use of `arguments` in the function body.
|
|
76785
76797
|
var parameter = ts.last(signature.parameters);
|
|
76786
|
-
if (
|
|
76798
|
+
if (parameter.valueDeclaration
|
|
76799
|
+
? !ts.getEffectiveTypeAnnotationNode(parameter.valueDeclaration)
|
|
76800
|
+
// a declarationless parameter may still have a `.type` already set by its construction logic
|
|
76801
|
+
// (which may pull a type from a jsdoc) - only allow fixing on `DeferredType` parameters with a fallback type
|
|
76802
|
+
: !!(ts.getCheckFlags(parameter) & 65536 /* DeferredType */)) {
|
|
76787
76803
|
var contextualParameterType = getRestTypeAtPosition(context, len);
|
|
76788
76804
|
assignParameterType(parameter, contextualParameterType);
|
|
76789
76805
|
}
|
|
@@ -76802,8 +76818,8 @@ var ts;
|
|
|
76802
76818
|
var links = getSymbolLinks(parameter);
|
|
76803
76819
|
if (!links.type) {
|
|
76804
76820
|
var declaration = parameter.valueDeclaration;
|
|
76805
|
-
links.type = type || getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true);
|
|
76806
|
-
if (declaration.name.kind !== 79 /* Identifier */) {
|
|
76821
|
+
links.type = type || (declaration ? getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true) : getTypeOfSymbol(parameter));
|
|
76822
|
+
if (declaration && declaration.name.kind !== 79 /* Identifier */) {
|
|
76807
76823
|
// if inference didn't come up with anything but unknown, fall back to the binding pattern if present.
|
|
76808
76824
|
if (links.type === unknownType) {
|
|
76809
76825
|
links.type = getTypeFromBindingPattern(declaration.name);
|
|
@@ -87471,10 +87487,9 @@ var ts;
|
|
|
87471
87487
|
}
|
|
87472
87488
|
var parent = ts.walkUpParenthesizedTypes(node.parent);
|
|
87473
87489
|
if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) {
|
|
87474
|
-
|
|
87475
|
-
if (
|
|
87476
|
-
|
|
87477
|
-
parent = parent.parent.parent;
|
|
87490
|
+
var host_2 = ts.getJSDocHost(parent);
|
|
87491
|
+
if (host_2) {
|
|
87492
|
+
parent = ts.getSingleVariableOfVariableStatement(host_2) || host_2;
|
|
87478
87493
|
}
|
|
87479
87494
|
}
|
|
87480
87495
|
switch (parent.kind) {
|
|
@@ -130292,14 +130307,15 @@ var ts;
|
|
|
130292
130307
|
SortText["SuggestedClassMembers"] = "14";
|
|
130293
130308
|
SortText["GlobalsOrKeywords"] = "15";
|
|
130294
130309
|
SortText["AutoImportSuggestions"] = "16";
|
|
130295
|
-
SortText["
|
|
130296
|
-
SortText["
|
|
130297
|
-
SortText["
|
|
130298
|
-
SortText["
|
|
130299
|
-
SortText["
|
|
130300
|
-
SortText["
|
|
130301
|
-
SortText["
|
|
130302
|
-
SortText["
|
|
130310
|
+
SortText["ClassMemberSnippets"] = "17";
|
|
130311
|
+
SortText["JavascriptIdentifiers"] = "18";
|
|
130312
|
+
SortText["DeprecatedLocalDeclarationPriority"] = "19";
|
|
130313
|
+
SortText["DeprecatedLocationPriority"] = "20";
|
|
130314
|
+
SortText["DeprecatedOptionalMember"] = "21";
|
|
130315
|
+
SortText["DeprecatedMemberDeclaredBySpreadAssignment"] = "22";
|
|
130316
|
+
SortText["DeprecatedSuggestedClassMembers"] = "23";
|
|
130317
|
+
SortText["DeprecatedGlobalsOrKeywords"] = "24";
|
|
130318
|
+
SortText["DeprecatedAutoImportSuggestions"] = "25";
|
|
130303
130319
|
})(SortText = Completions.SortText || (Completions.SortText = {}));
|
|
130304
130320
|
var SortTextId;
|
|
130305
130321
|
(function (SortTextId) {
|
|
@@ -130311,10 +130327,10 @@ var ts;
|
|
|
130311
130327
|
SortTextId[SortTextId["GlobalsOrKeywords"] = 15] = "GlobalsOrKeywords";
|
|
130312
130328
|
SortTextId[SortTextId["AutoImportSuggestions"] = 16] = "AutoImportSuggestions";
|
|
130313
130329
|
// Don't use these directly.
|
|
130314
|
-
SortTextId[SortTextId["_JavaScriptIdentifiers"] =
|
|
130315
|
-
SortTextId[SortTextId["_DeprecatedStart"] =
|
|
130330
|
+
SortTextId[SortTextId["_JavaScriptIdentifiers"] = 18] = "_JavaScriptIdentifiers";
|
|
130331
|
+
SortTextId[SortTextId["_DeprecatedStart"] = 19] = "_DeprecatedStart";
|
|
130316
130332
|
SortTextId[SortTextId["_First"] = 10] = "_First";
|
|
130317
|
-
SortTextId[SortTextId["DeprecatedOffset"] =
|
|
130333
|
+
SortTextId[SortTextId["DeprecatedOffset"] = 9] = "DeprecatedOffset";
|
|
130318
130334
|
})(SortTextId || (SortTextId = {}));
|
|
130319
130335
|
/**
|
|
130320
130336
|
* Special values for `CompletionInfo['source']` used to disambiguate
|
|
@@ -130795,6 +130811,7 @@ var ts;
|
|
|
130795
130811
|
isClassLikeMemberCompletion(symbol, location)) {
|
|
130796
130812
|
var importAdder = void 0;
|
|
130797
130813
|
(_b = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken, formatContext), insertText = _b.insertText, isSnippet = _b.isSnippet, importAdder = _b.importAdder, replacementSpan = _b.replacementSpan);
|
|
130814
|
+
sortText = SortText.ClassMemberSnippets; // sortText has to be lower priority than the sortText for keywords. See #47852.
|
|
130798
130815
|
if (importAdder === null || importAdder === void 0 ? void 0 : importAdder.hasFixes()) {
|
|
130799
130816
|
hasAction = true;
|
|
130800
130817
|
source = CompletionSource.ClassMemberSnippet;
|
|
@@ -131158,7 +131175,7 @@ var ts;
|
|
|
131158
131175
|
}
|
|
131159
131176
|
var name = info.name, needsConvertPropertyAccess = info.needsConvertPropertyAccess;
|
|
131160
131177
|
var sortTextId = (_a = symbolToSortTextIdMap === null || symbolToSortTextIdMap === void 0 ? void 0 : symbolToSortTextIdMap[ts.getSymbolId(symbol)]) !== null && _a !== void 0 ? _a : 11 /* LocationPriority */;
|
|
131161
|
-
var sortText = (isDeprecated(symbol, typeChecker) ?
|
|
131178
|
+
var sortText = (isDeprecated(symbol, typeChecker) ? 9 /* DeprecatedOffset */ + sortTextId : sortTextId).toString();
|
|
131162
131179
|
var entry = createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importCompletionNode, useSemicolons, compilerOptions, preferences, kind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag);
|
|
131163
131180
|
if (!entry) {
|
|
131164
131181
|
continue;
|
|
@@ -142398,7 +142415,7 @@ var ts;
|
|
|
142398
142415
|
if (!typeDisplayString) {
|
|
142399
142416
|
continue;
|
|
142400
142417
|
}
|
|
142401
|
-
addTypeHints(typeDisplayString, param.name.end);
|
|
142418
|
+
addTypeHints(typeDisplayString, param.questionToken ? param.questionToken.end : param.name.end);
|
|
142402
142419
|
}
|
|
142403
142420
|
}
|
|
142404
142421
|
function getParameterDeclarationTypeDisplayString(symbol) {
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220317";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -59090,7 +59090,19 @@ var ts;
|
|
|
59090
59090
|
return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined;
|
|
59091
59091
|
});
|
|
59092
59092
|
var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args", 32768 /* RestParameter */);
|
|
59093
|
-
|
|
59093
|
+
if (lastParamVariadicType) {
|
|
59094
|
+
// Parameter has effective annotation, lock in type
|
|
59095
|
+
syntheticArgsSymbol.type = createArrayType(getTypeFromTypeNode(lastParamVariadicType.type));
|
|
59096
|
+
}
|
|
59097
|
+
else {
|
|
59098
|
+
// Parameter has no annotation
|
|
59099
|
+
// By using a `DeferredType` symbol, we allow the type of this rest arg to be overriden by contextual type assignment so long as its type hasn't been
|
|
59100
|
+
// cached by `getTypeOfSymbol` yet.
|
|
59101
|
+
syntheticArgsSymbol.checkFlags |= 65536 /* DeferredType */;
|
|
59102
|
+
syntheticArgsSymbol.deferralParent = neverType;
|
|
59103
|
+
syntheticArgsSymbol.deferralConstituents = [anyArrayType];
|
|
59104
|
+
syntheticArgsSymbol.deferralWriteConstituents = [anyArrayType];
|
|
59105
|
+
}
|
|
59094
59106
|
if (lastParamVariadicType) {
|
|
59095
59107
|
// Replace the last parameter with a rest parameter.
|
|
59096
59108
|
parameters.pop();
|
|
@@ -76977,7 +76989,11 @@ var ts;
|
|
|
76977
76989
|
if (signatureHasRestParameter(signature)) {
|
|
76978
76990
|
// parameter might be a transient symbol generated by use of `arguments` in the function body.
|
|
76979
76991
|
var parameter = ts.last(signature.parameters);
|
|
76980
|
-
if (
|
|
76992
|
+
if (parameter.valueDeclaration
|
|
76993
|
+
? !ts.getEffectiveTypeAnnotationNode(parameter.valueDeclaration)
|
|
76994
|
+
// a declarationless parameter may still have a `.type` already set by its construction logic
|
|
76995
|
+
// (which may pull a type from a jsdoc) - only allow fixing on `DeferredType` parameters with a fallback type
|
|
76996
|
+
: !!(ts.getCheckFlags(parameter) & 65536 /* DeferredType */)) {
|
|
76981
76997
|
var contextualParameterType = getRestTypeAtPosition(context, len);
|
|
76982
76998
|
assignParameterType(parameter, contextualParameterType);
|
|
76983
76999
|
}
|
|
@@ -76996,8 +77012,8 @@ var ts;
|
|
|
76996
77012
|
var links = getSymbolLinks(parameter);
|
|
76997
77013
|
if (!links.type) {
|
|
76998
77014
|
var declaration = parameter.valueDeclaration;
|
|
76999
|
-
links.type = type || getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true);
|
|
77000
|
-
if (declaration.name.kind !== 79 /* Identifier */) {
|
|
77015
|
+
links.type = type || (declaration ? getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true) : getTypeOfSymbol(parameter));
|
|
77016
|
+
if (declaration && declaration.name.kind !== 79 /* Identifier */) {
|
|
77001
77017
|
// if inference didn't come up with anything but unknown, fall back to the binding pattern if present.
|
|
77002
77018
|
if (links.type === unknownType) {
|
|
77003
77019
|
links.type = getTypeFromBindingPattern(declaration.name);
|
|
@@ -87665,10 +87681,9 @@ var ts;
|
|
|
87665
87681
|
}
|
|
87666
87682
|
var parent = ts.walkUpParenthesizedTypes(node.parent);
|
|
87667
87683
|
if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) {
|
|
87668
|
-
|
|
87669
|
-
if (
|
|
87670
|
-
|
|
87671
|
-
parent = parent.parent.parent;
|
|
87684
|
+
var host_2 = ts.getJSDocHost(parent);
|
|
87685
|
+
if (host_2) {
|
|
87686
|
+
parent = ts.getSingleVariableOfVariableStatement(host_2) || host_2;
|
|
87672
87687
|
}
|
|
87673
87688
|
}
|
|
87674
87689
|
switch (parent.kind) {
|
|
@@ -130903,14 +130918,15 @@ var ts;
|
|
|
130903
130918
|
SortText["SuggestedClassMembers"] = "14";
|
|
130904
130919
|
SortText["GlobalsOrKeywords"] = "15";
|
|
130905
130920
|
SortText["AutoImportSuggestions"] = "16";
|
|
130906
|
-
SortText["
|
|
130907
|
-
SortText["
|
|
130908
|
-
SortText["
|
|
130909
|
-
SortText["
|
|
130910
|
-
SortText["
|
|
130911
|
-
SortText["
|
|
130912
|
-
SortText["
|
|
130913
|
-
SortText["
|
|
130921
|
+
SortText["ClassMemberSnippets"] = "17";
|
|
130922
|
+
SortText["JavascriptIdentifiers"] = "18";
|
|
130923
|
+
SortText["DeprecatedLocalDeclarationPriority"] = "19";
|
|
130924
|
+
SortText["DeprecatedLocationPriority"] = "20";
|
|
130925
|
+
SortText["DeprecatedOptionalMember"] = "21";
|
|
130926
|
+
SortText["DeprecatedMemberDeclaredBySpreadAssignment"] = "22";
|
|
130927
|
+
SortText["DeprecatedSuggestedClassMembers"] = "23";
|
|
130928
|
+
SortText["DeprecatedGlobalsOrKeywords"] = "24";
|
|
130929
|
+
SortText["DeprecatedAutoImportSuggestions"] = "25";
|
|
130914
130930
|
})(SortText = Completions.SortText || (Completions.SortText = {}));
|
|
130915
130931
|
var SortTextId;
|
|
130916
130932
|
(function (SortTextId) {
|
|
@@ -130922,10 +130938,10 @@ var ts;
|
|
|
130922
130938
|
SortTextId[SortTextId["GlobalsOrKeywords"] = 15] = "GlobalsOrKeywords";
|
|
130923
130939
|
SortTextId[SortTextId["AutoImportSuggestions"] = 16] = "AutoImportSuggestions";
|
|
130924
130940
|
// Don't use these directly.
|
|
130925
|
-
SortTextId[SortTextId["_JavaScriptIdentifiers"] =
|
|
130926
|
-
SortTextId[SortTextId["_DeprecatedStart"] =
|
|
130941
|
+
SortTextId[SortTextId["_JavaScriptIdentifiers"] = 18] = "_JavaScriptIdentifiers";
|
|
130942
|
+
SortTextId[SortTextId["_DeprecatedStart"] = 19] = "_DeprecatedStart";
|
|
130927
130943
|
SortTextId[SortTextId["_First"] = 10] = "_First";
|
|
130928
|
-
SortTextId[SortTextId["DeprecatedOffset"] =
|
|
130944
|
+
SortTextId[SortTextId["DeprecatedOffset"] = 9] = "DeprecatedOffset";
|
|
130929
130945
|
})(SortTextId || (SortTextId = {}));
|
|
130930
130946
|
/**
|
|
130931
130947
|
* Special values for `CompletionInfo['source']` used to disambiguate
|
|
@@ -131406,6 +131422,7 @@ var ts;
|
|
|
131406
131422
|
isClassLikeMemberCompletion(symbol, location)) {
|
|
131407
131423
|
var importAdder = void 0;
|
|
131408
131424
|
(_b = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken, formatContext), insertText = _b.insertText, isSnippet = _b.isSnippet, importAdder = _b.importAdder, replacementSpan = _b.replacementSpan);
|
|
131425
|
+
sortText = SortText.ClassMemberSnippets; // sortText has to be lower priority than the sortText for keywords. See #47852.
|
|
131409
131426
|
if (importAdder === null || importAdder === void 0 ? void 0 : importAdder.hasFixes()) {
|
|
131410
131427
|
hasAction = true;
|
|
131411
131428
|
source = CompletionSource.ClassMemberSnippet;
|
|
@@ -131769,7 +131786,7 @@ var ts;
|
|
|
131769
131786
|
}
|
|
131770
131787
|
var name = info.name, needsConvertPropertyAccess = info.needsConvertPropertyAccess;
|
|
131771
131788
|
var sortTextId = (_a = symbolToSortTextIdMap === null || symbolToSortTextIdMap === void 0 ? void 0 : symbolToSortTextIdMap[ts.getSymbolId(symbol)]) !== null && _a !== void 0 ? _a : 11 /* LocationPriority */;
|
|
131772
|
-
var sortText = (isDeprecated(symbol, typeChecker) ?
|
|
131789
|
+
var sortText = (isDeprecated(symbol, typeChecker) ? 9 /* DeprecatedOffset */ + sortTextId : sortTextId).toString();
|
|
131773
131790
|
var entry = createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importCompletionNode, useSemicolons, compilerOptions, preferences, kind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag);
|
|
131774
131791
|
if (!entry) {
|
|
131775
131792
|
continue;
|
|
@@ -143009,7 +143026,7 @@ var ts;
|
|
|
143009
143026
|
if (!typeDisplayString) {
|
|
143010
143027
|
continue;
|
|
143011
143028
|
}
|
|
143012
|
-
addTypeHints(typeDisplayString, param.name.end);
|
|
143029
|
+
addTypeHints(typeDisplayString, param.questionToken ? param.questionToken.end : param.name.end);
|
|
143013
143030
|
}
|
|
143014
143031
|
}
|
|
143015
143032
|
function getParameterDeclarationTypeDisplayString(symbol) {
|
package/lib/typescript.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220317";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -59090,7 +59090,19 @@ var ts;
|
|
|
59090
59090
|
return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined;
|
|
59091
59091
|
});
|
|
59092
59092
|
var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args", 32768 /* RestParameter */);
|
|
59093
|
-
|
|
59093
|
+
if (lastParamVariadicType) {
|
|
59094
|
+
// Parameter has effective annotation, lock in type
|
|
59095
|
+
syntheticArgsSymbol.type = createArrayType(getTypeFromTypeNode(lastParamVariadicType.type));
|
|
59096
|
+
}
|
|
59097
|
+
else {
|
|
59098
|
+
// Parameter has no annotation
|
|
59099
|
+
// By using a `DeferredType` symbol, we allow the type of this rest arg to be overriden by contextual type assignment so long as its type hasn't been
|
|
59100
|
+
// cached by `getTypeOfSymbol` yet.
|
|
59101
|
+
syntheticArgsSymbol.checkFlags |= 65536 /* DeferredType */;
|
|
59102
|
+
syntheticArgsSymbol.deferralParent = neverType;
|
|
59103
|
+
syntheticArgsSymbol.deferralConstituents = [anyArrayType];
|
|
59104
|
+
syntheticArgsSymbol.deferralWriteConstituents = [anyArrayType];
|
|
59105
|
+
}
|
|
59094
59106
|
if (lastParamVariadicType) {
|
|
59095
59107
|
// Replace the last parameter with a rest parameter.
|
|
59096
59108
|
parameters.pop();
|
|
@@ -76977,7 +76989,11 @@ var ts;
|
|
|
76977
76989
|
if (signatureHasRestParameter(signature)) {
|
|
76978
76990
|
// parameter might be a transient symbol generated by use of `arguments` in the function body.
|
|
76979
76991
|
var parameter = ts.last(signature.parameters);
|
|
76980
|
-
if (
|
|
76992
|
+
if (parameter.valueDeclaration
|
|
76993
|
+
? !ts.getEffectiveTypeAnnotationNode(parameter.valueDeclaration)
|
|
76994
|
+
// a declarationless parameter may still have a `.type` already set by its construction logic
|
|
76995
|
+
// (which may pull a type from a jsdoc) - only allow fixing on `DeferredType` parameters with a fallback type
|
|
76996
|
+
: !!(ts.getCheckFlags(parameter) & 65536 /* DeferredType */)) {
|
|
76981
76997
|
var contextualParameterType = getRestTypeAtPosition(context, len);
|
|
76982
76998
|
assignParameterType(parameter, contextualParameterType);
|
|
76983
76999
|
}
|
|
@@ -76996,8 +77012,8 @@ var ts;
|
|
|
76996
77012
|
var links = getSymbolLinks(parameter);
|
|
76997
77013
|
if (!links.type) {
|
|
76998
77014
|
var declaration = parameter.valueDeclaration;
|
|
76999
|
-
links.type = type || getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true);
|
|
77000
|
-
if (declaration.name.kind !== 79 /* Identifier */) {
|
|
77015
|
+
links.type = type || (declaration ? getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true) : getTypeOfSymbol(parameter));
|
|
77016
|
+
if (declaration && declaration.name.kind !== 79 /* Identifier */) {
|
|
77001
77017
|
// if inference didn't come up with anything but unknown, fall back to the binding pattern if present.
|
|
77002
77018
|
if (links.type === unknownType) {
|
|
77003
77019
|
links.type = getTypeFromBindingPattern(declaration.name);
|
|
@@ -87665,10 +87681,9 @@ var ts;
|
|
|
87665
87681
|
}
|
|
87666
87682
|
var parent = ts.walkUpParenthesizedTypes(node.parent);
|
|
87667
87683
|
if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) {
|
|
87668
|
-
|
|
87669
|
-
if (
|
|
87670
|
-
|
|
87671
|
-
parent = parent.parent.parent;
|
|
87684
|
+
var host_2 = ts.getJSDocHost(parent);
|
|
87685
|
+
if (host_2) {
|
|
87686
|
+
parent = ts.getSingleVariableOfVariableStatement(host_2) || host_2;
|
|
87672
87687
|
}
|
|
87673
87688
|
}
|
|
87674
87689
|
switch (parent.kind) {
|
|
@@ -130903,14 +130918,15 @@ var ts;
|
|
|
130903
130918
|
SortText["SuggestedClassMembers"] = "14";
|
|
130904
130919
|
SortText["GlobalsOrKeywords"] = "15";
|
|
130905
130920
|
SortText["AutoImportSuggestions"] = "16";
|
|
130906
|
-
SortText["
|
|
130907
|
-
SortText["
|
|
130908
|
-
SortText["
|
|
130909
|
-
SortText["
|
|
130910
|
-
SortText["
|
|
130911
|
-
SortText["
|
|
130912
|
-
SortText["
|
|
130913
|
-
SortText["
|
|
130921
|
+
SortText["ClassMemberSnippets"] = "17";
|
|
130922
|
+
SortText["JavascriptIdentifiers"] = "18";
|
|
130923
|
+
SortText["DeprecatedLocalDeclarationPriority"] = "19";
|
|
130924
|
+
SortText["DeprecatedLocationPriority"] = "20";
|
|
130925
|
+
SortText["DeprecatedOptionalMember"] = "21";
|
|
130926
|
+
SortText["DeprecatedMemberDeclaredBySpreadAssignment"] = "22";
|
|
130927
|
+
SortText["DeprecatedSuggestedClassMembers"] = "23";
|
|
130928
|
+
SortText["DeprecatedGlobalsOrKeywords"] = "24";
|
|
130929
|
+
SortText["DeprecatedAutoImportSuggestions"] = "25";
|
|
130914
130930
|
})(SortText = Completions.SortText || (Completions.SortText = {}));
|
|
130915
130931
|
var SortTextId;
|
|
130916
130932
|
(function (SortTextId) {
|
|
@@ -130922,10 +130938,10 @@ var ts;
|
|
|
130922
130938
|
SortTextId[SortTextId["GlobalsOrKeywords"] = 15] = "GlobalsOrKeywords";
|
|
130923
130939
|
SortTextId[SortTextId["AutoImportSuggestions"] = 16] = "AutoImportSuggestions";
|
|
130924
130940
|
// Don't use these directly.
|
|
130925
|
-
SortTextId[SortTextId["_JavaScriptIdentifiers"] =
|
|
130926
|
-
SortTextId[SortTextId["_DeprecatedStart"] =
|
|
130941
|
+
SortTextId[SortTextId["_JavaScriptIdentifiers"] = 18] = "_JavaScriptIdentifiers";
|
|
130942
|
+
SortTextId[SortTextId["_DeprecatedStart"] = 19] = "_DeprecatedStart";
|
|
130927
130943
|
SortTextId[SortTextId["_First"] = 10] = "_First";
|
|
130928
|
-
SortTextId[SortTextId["DeprecatedOffset"] =
|
|
130944
|
+
SortTextId[SortTextId["DeprecatedOffset"] = 9] = "DeprecatedOffset";
|
|
130929
130945
|
})(SortTextId || (SortTextId = {}));
|
|
130930
130946
|
/**
|
|
130931
130947
|
* Special values for `CompletionInfo['source']` used to disambiguate
|
|
@@ -131406,6 +131422,7 @@ var ts;
|
|
|
131406
131422
|
isClassLikeMemberCompletion(symbol, location)) {
|
|
131407
131423
|
var importAdder = void 0;
|
|
131408
131424
|
(_b = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken, formatContext), insertText = _b.insertText, isSnippet = _b.isSnippet, importAdder = _b.importAdder, replacementSpan = _b.replacementSpan);
|
|
131425
|
+
sortText = SortText.ClassMemberSnippets; // sortText has to be lower priority than the sortText for keywords. See #47852.
|
|
131409
131426
|
if (importAdder === null || importAdder === void 0 ? void 0 : importAdder.hasFixes()) {
|
|
131410
131427
|
hasAction = true;
|
|
131411
131428
|
source = CompletionSource.ClassMemberSnippet;
|
|
@@ -131769,7 +131786,7 @@ var ts;
|
|
|
131769
131786
|
}
|
|
131770
131787
|
var name = info.name, needsConvertPropertyAccess = info.needsConvertPropertyAccess;
|
|
131771
131788
|
var sortTextId = (_a = symbolToSortTextIdMap === null || symbolToSortTextIdMap === void 0 ? void 0 : symbolToSortTextIdMap[ts.getSymbolId(symbol)]) !== null && _a !== void 0 ? _a : 11 /* LocationPriority */;
|
|
131772
|
-
var sortText = (isDeprecated(symbol, typeChecker) ?
|
|
131789
|
+
var sortText = (isDeprecated(symbol, typeChecker) ? 9 /* DeprecatedOffset */ + sortTextId : sortTextId).toString();
|
|
131773
131790
|
var entry = createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importCompletionNode, useSemicolons, compilerOptions, preferences, kind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag);
|
|
131774
131791
|
if (!entry) {
|
|
131775
131792
|
continue;
|
|
@@ -143009,7 +143026,7 @@ var ts;
|
|
|
143009
143026
|
if (!typeDisplayString) {
|
|
143010
143027
|
continue;
|
|
143011
143028
|
}
|
|
143012
|
-
addTypeHints(typeDisplayString, param.name.end);
|
|
143029
|
+
addTypeHints(typeDisplayString, param.questionToken ? param.questionToken.end : param.name.end);
|
|
143013
143030
|
}
|
|
143014
143031
|
}
|
|
143015
143032
|
function getParameterDeclarationTypeDisplayString(symbol) {
|
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220317";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -59090,7 +59090,19 @@ var ts;
|
|
|
59090
59090
|
return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined;
|
|
59091
59091
|
});
|
|
59092
59092
|
var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args", 32768 /* RestParameter */);
|
|
59093
|
-
|
|
59093
|
+
if (lastParamVariadicType) {
|
|
59094
|
+
// Parameter has effective annotation, lock in type
|
|
59095
|
+
syntheticArgsSymbol.type = createArrayType(getTypeFromTypeNode(lastParamVariadicType.type));
|
|
59096
|
+
}
|
|
59097
|
+
else {
|
|
59098
|
+
// Parameter has no annotation
|
|
59099
|
+
// By using a `DeferredType` symbol, we allow the type of this rest arg to be overriden by contextual type assignment so long as its type hasn't been
|
|
59100
|
+
// cached by `getTypeOfSymbol` yet.
|
|
59101
|
+
syntheticArgsSymbol.checkFlags |= 65536 /* DeferredType */;
|
|
59102
|
+
syntheticArgsSymbol.deferralParent = neverType;
|
|
59103
|
+
syntheticArgsSymbol.deferralConstituents = [anyArrayType];
|
|
59104
|
+
syntheticArgsSymbol.deferralWriteConstituents = [anyArrayType];
|
|
59105
|
+
}
|
|
59094
59106
|
if (lastParamVariadicType) {
|
|
59095
59107
|
// Replace the last parameter with a rest parameter.
|
|
59096
59108
|
parameters.pop();
|
|
@@ -76977,7 +76989,11 @@ var ts;
|
|
|
76977
76989
|
if (signatureHasRestParameter(signature)) {
|
|
76978
76990
|
// parameter might be a transient symbol generated by use of `arguments` in the function body.
|
|
76979
76991
|
var parameter = ts.last(signature.parameters);
|
|
76980
|
-
if (
|
|
76992
|
+
if (parameter.valueDeclaration
|
|
76993
|
+
? !ts.getEffectiveTypeAnnotationNode(parameter.valueDeclaration)
|
|
76994
|
+
// a declarationless parameter may still have a `.type` already set by its construction logic
|
|
76995
|
+
// (which may pull a type from a jsdoc) - only allow fixing on `DeferredType` parameters with a fallback type
|
|
76996
|
+
: !!(ts.getCheckFlags(parameter) & 65536 /* DeferredType */)) {
|
|
76981
76997
|
var contextualParameterType = getRestTypeAtPosition(context, len);
|
|
76982
76998
|
assignParameterType(parameter, contextualParameterType);
|
|
76983
76999
|
}
|
|
@@ -76996,8 +77012,8 @@ var ts;
|
|
|
76996
77012
|
var links = getSymbolLinks(parameter);
|
|
76997
77013
|
if (!links.type) {
|
|
76998
77014
|
var declaration = parameter.valueDeclaration;
|
|
76999
|
-
links.type = type || getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true);
|
|
77000
|
-
if (declaration.name.kind !== 79 /* Identifier */) {
|
|
77015
|
+
links.type = type || (declaration ? getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true) : getTypeOfSymbol(parameter));
|
|
77016
|
+
if (declaration && declaration.name.kind !== 79 /* Identifier */) {
|
|
77001
77017
|
// if inference didn't come up with anything but unknown, fall back to the binding pattern if present.
|
|
77002
77018
|
if (links.type === unknownType) {
|
|
77003
77019
|
links.type = getTypeFromBindingPattern(declaration.name);
|
|
@@ -87665,10 +87681,9 @@ var ts;
|
|
|
87665
87681
|
}
|
|
87666
87682
|
var parent = ts.walkUpParenthesizedTypes(node.parent);
|
|
87667
87683
|
if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) {
|
|
87668
|
-
|
|
87669
|
-
if (
|
|
87670
|
-
|
|
87671
|
-
parent = parent.parent.parent;
|
|
87684
|
+
var host_2 = ts.getJSDocHost(parent);
|
|
87685
|
+
if (host_2) {
|
|
87686
|
+
parent = ts.getSingleVariableOfVariableStatement(host_2) || host_2;
|
|
87672
87687
|
}
|
|
87673
87688
|
}
|
|
87674
87689
|
switch (parent.kind) {
|
|
@@ -130903,14 +130918,15 @@ var ts;
|
|
|
130903
130918
|
SortText["SuggestedClassMembers"] = "14";
|
|
130904
130919
|
SortText["GlobalsOrKeywords"] = "15";
|
|
130905
130920
|
SortText["AutoImportSuggestions"] = "16";
|
|
130906
|
-
SortText["
|
|
130907
|
-
SortText["
|
|
130908
|
-
SortText["
|
|
130909
|
-
SortText["
|
|
130910
|
-
SortText["
|
|
130911
|
-
SortText["
|
|
130912
|
-
SortText["
|
|
130913
|
-
SortText["
|
|
130921
|
+
SortText["ClassMemberSnippets"] = "17";
|
|
130922
|
+
SortText["JavascriptIdentifiers"] = "18";
|
|
130923
|
+
SortText["DeprecatedLocalDeclarationPriority"] = "19";
|
|
130924
|
+
SortText["DeprecatedLocationPriority"] = "20";
|
|
130925
|
+
SortText["DeprecatedOptionalMember"] = "21";
|
|
130926
|
+
SortText["DeprecatedMemberDeclaredBySpreadAssignment"] = "22";
|
|
130927
|
+
SortText["DeprecatedSuggestedClassMembers"] = "23";
|
|
130928
|
+
SortText["DeprecatedGlobalsOrKeywords"] = "24";
|
|
130929
|
+
SortText["DeprecatedAutoImportSuggestions"] = "25";
|
|
130914
130930
|
})(SortText = Completions.SortText || (Completions.SortText = {}));
|
|
130915
130931
|
var SortTextId;
|
|
130916
130932
|
(function (SortTextId) {
|
|
@@ -130922,10 +130938,10 @@ var ts;
|
|
|
130922
130938
|
SortTextId[SortTextId["GlobalsOrKeywords"] = 15] = "GlobalsOrKeywords";
|
|
130923
130939
|
SortTextId[SortTextId["AutoImportSuggestions"] = 16] = "AutoImportSuggestions";
|
|
130924
130940
|
// Don't use these directly.
|
|
130925
|
-
SortTextId[SortTextId["_JavaScriptIdentifiers"] =
|
|
130926
|
-
SortTextId[SortTextId["_DeprecatedStart"] =
|
|
130941
|
+
SortTextId[SortTextId["_JavaScriptIdentifiers"] = 18] = "_JavaScriptIdentifiers";
|
|
130942
|
+
SortTextId[SortTextId["_DeprecatedStart"] = 19] = "_DeprecatedStart";
|
|
130927
130943
|
SortTextId[SortTextId["_First"] = 10] = "_First";
|
|
130928
|
-
SortTextId[SortTextId["DeprecatedOffset"] =
|
|
130944
|
+
SortTextId[SortTextId["DeprecatedOffset"] = 9] = "DeprecatedOffset";
|
|
130929
130945
|
})(SortTextId || (SortTextId = {}));
|
|
130930
130946
|
/**
|
|
130931
130947
|
* Special values for `CompletionInfo['source']` used to disambiguate
|
|
@@ -131406,6 +131422,7 @@ var ts;
|
|
|
131406
131422
|
isClassLikeMemberCompletion(symbol, location)) {
|
|
131407
131423
|
var importAdder = void 0;
|
|
131408
131424
|
(_b = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken, formatContext), insertText = _b.insertText, isSnippet = _b.isSnippet, importAdder = _b.importAdder, replacementSpan = _b.replacementSpan);
|
|
131425
|
+
sortText = SortText.ClassMemberSnippets; // sortText has to be lower priority than the sortText for keywords. See #47852.
|
|
131409
131426
|
if (importAdder === null || importAdder === void 0 ? void 0 : importAdder.hasFixes()) {
|
|
131410
131427
|
hasAction = true;
|
|
131411
131428
|
source = CompletionSource.ClassMemberSnippet;
|
|
@@ -131769,7 +131786,7 @@ var ts;
|
|
|
131769
131786
|
}
|
|
131770
131787
|
var name = info.name, needsConvertPropertyAccess = info.needsConvertPropertyAccess;
|
|
131771
131788
|
var sortTextId = (_a = symbolToSortTextIdMap === null || symbolToSortTextIdMap === void 0 ? void 0 : symbolToSortTextIdMap[ts.getSymbolId(symbol)]) !== null && _a !== void 0 ? _a : 11 /* LocationPriority */;
|
|
131772
|
-
var sortText = (isDeprecated(symbol, typeChecker) ?
|
|
131789
|
+
var sortText = (isDeprecated(symbol, typeChecker) ? 9 /* DeprecatedOffset */ + sortTextId : sortTextId).toString();
|
|
131773
131790
|
var entry = createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importCompletionNode, useSemicolons, compilerOptions, preferences, kind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag);
|
|
131774
131791
|
if (!entry) {
|
|
131775
131792
|
continue;
|
|
@@ -143009,7 +143026,7 @@ var ts;
|
|
|
143009
143026
|
if (!typeDisplayString) {
|
|
143010
143027
|
continue;
|
|
143011
143028
|
}
|
|
143012
|
-
addTypeHints(typeDisplayString, param.name.end);
|
|
143029
|
+
addTypeHints(typeDisplayString, param.questionToken ? param.questionToken.end : param.name.end);
|
|
143013
143030
|
}
|
|
143014
143031
|
}
|
|
143015
143032
|
function getParameterDeclarationTypeDisplayString(symbol) {
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220317";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -58885,7 +58885,19 @@ var ts;
|
|
|
58885
58885
|
return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined;
|
|
58886
58886
|
});
|
|
58887
58887
|
var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args", 32768 /* RestParameter */);
|
|
58888
|
-
|
|
58888
|
+
if (lastParamVariadicType) {
|
|
58889
|
+
// Parameter has effective annotation, lock in type
|
|
58890
|
+
syntheticArgsSymbol.type = createArrayType(getTypeFromTypeNode(lastParamVariadicType.type));
|
|
58891
|
+
}
|
|
58892
|
+
else {
|
|
58893
|
+
// Parameter has no annotation
|
|
58894
|
+
// By using a `DeferredType` symbol, we allow the type of this rest arg to be overriden by contextual type assignment so long as its type hasn't been
|
|
58895
|
+
// cached by `getTypeOfSymbol` yet.
|
|
58896
|
+
syntheticArgsSymbol.checkFlags |= 65536 /* DeferredType */;
|
|
58897
|
+
syntheticArgsSymbol.deferralParent = neverType;
|
|
58898
|
+
syntheticArgsSymbol.deferralConstituents = [anyArrayType];
|
|
58899
|
+
syntheticArgsSymbol.deferralWriteConstituents = [anyArrayType];
|
|
58900
|
+
}
|
|
58889
58901
|
if (lastParamVariadicType) {
|
|
58890
58902
|
// Replace the last parameter with a rest parameter.
|
|
58891
58903
|
parameters.pop();
|
|
@@ -76772,7 +76784,11 @@ var ts;
|
|
|
76772
76784
|
if (signatureHasRestParameter(signature)) {
|
|
76773
76785
|
// parameter might be a transient symbol generated by use of `arguments` in the function body.
|
|
76774
76786
|
var parameter = ts.last(signature.parameters);
|
|
76775
|
-
if (
|
|
76787
|
+
if (parameter.valueDeclaration
|
|
76788
|
+
? !ts.getEffectiveTypeAnnotationNode(parameter.valueDeclaration)
|
|
76789
|
+
// a declarationless parameter may still have a `.type` already set by its construction logic
|
|
76790
|
+
// (which may pull a type from a jsdoc) - only allow fixing on `DeferredType` parameters with a fallback type
|
|
76791
|
+
: !!(ts.getCheckFlags(parameter) & 65536 /* DeferredType */)) {
|
|
76776
76792
|
var contextualParameterType = getRestTypeAtPosition(context, len);
|
|
76777
76793
|
assignParameterType(parameter, contextualParameterType);
|
|
76778
76794
|
}
|
|
@@ -76791,8 +76807,8 @@ var ts;
|
|
|
76791
76807
|
var links = getSymbolLinks(parameter);
|
|
76792
76808
|
if (!links.type) {
|
|
76793
76809
|
var declaration = parameter.valueDeclaration;
|
|
76794
|
-
links.type = type || getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true);
|
|
76795
|
-
if (declaration.name.kind !== 79 /* Identifier */) {
|
|
76810
|
+
links.type = type || (declaration ? getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true) : getTypeOfSymbol(parameter));
|
|
76811
|
+
if (declaration && declaration.name.kind !== 79 /* Identifier */) {
|
|
76796
76812
|
// if inference didn't come up with anything but unknown, fall back to the binding pattern if present.
|
|
76797
76813
|
if (links.type === unknownType) {
|
|
76798
76814
|
links.type = getTypeFromBindingPattern(declaration.name);
|
|
@@ -87460,10 +87476,9 @@ var ts;
|
|
|
87460
87476
|
}
|
|
87461
87477
|
var parent = ts.walkUpParenthesizedTypes(node.parent);
|
|
87462
87478
|
if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) {
|
|
87463
|
-
|
|
87464
|
-
if (
|
|
87465
|
-
|
|
87466
|
-
parent = parent.parent.parent;
|
|
87479
|
+
var host_2 = ts.getJSDocHost(parent);
|
|
87480
|
+
if (host_2) {
|
|
87481
|
+
parent = ts.getSingleVariableOfVariableStatement(host_2) || host_2;
|
|
87467
87482
|
}
|
|
87468
87483
|
}
|
|
87469
87484
|
switch (parent.kind) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "4.7.0-dev.
|
|
5
|
+
"version": "4.7.0-dev.20220317",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|