coc-pyright 1.1.393 → 1.1.394
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/index.js +204 -119
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -18909,6 +18909,10 @@ var require_package_nls_en_us = __commonJS({
|
|
|
18909
18909
|
message: '"{name}" was already declared nonlocal',
|
|
18910
18910
|
comment: "{Locked='nonlocal'}"
|
|
18911
18911
|
},
|
|
18912
|
+
nonlocalTypeParam: {
|
|
18913
|
+
message: 'Nonlocal binding is not allowed for type parameter "{name}"',
|
|
18914
|
+
comment: ["{StrContains=i'nonlocal'}", "'nonlocal' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
|
|
18915
|
+
},
|
|
18912
18916
|
noneNotCallable: {
|
|
18913
18917
|
message: 'Object of type "None" cannot be called',
|
|
18914
18918
|
comment: "{Locked='None'}"
|
|
@@ -19537,7 +19541,7 @@ var require_package_nls_en_us = __commonJS({
|
|
|
19537
19541
|
comment: "{Locked='True','False'}"
|
|
19538
19542
|
},
|
|
19539
19543
|
typedDictClosedExtras: {
|
|
19540
|
-
message: 'Base class "{name}" is a
|
|
19544
|
+
message: 'Base class "{name}" is a TypedDict that limits the type of extra items to type "{type}"',
|
|
19541
19545
|
comment: "{Locked='closed','TypedDict'}"
|
|
19542
19546
|
},
|
|
19543
19547
|
typedDictClosedNoExtras: {
|
|
@@ -19559,8 +19563,8 @@ var require_package_nls_en_us = __commonJS({
|
|
|
19559
19563
|
comment: "{Locked='TypedDict'}"
|
|
19560
19564
|
},
|
|
19561
19565
|
typedDictExtraItemsClosed: {
|
|
19562
|
-
message:
|
|
19563
|
-
comment: "{Locked='TypedDict','closed'}"
|
|
19566
|
+
message: 'TypedDict can use either "closed" or "extra_items" but not both',
|
|
19567
|
+
comment: "{Locked='TypedDict','closed','extra_items'}"
|
|
19564
19568
|
},
|
|
19565
19569
|
typedDictFieldNotRequiredRedefinition: {
|
|
19566
19570
|
message: 'TypedDict item "{name}" cannot be redefined as NotRequired',
|
|
@@ -30724,11 +30728,12 @@ var require_localize = __commonJS({
|
|
|
30724
30728
|
Diagnostic4.noneNotUsableWithAsync = () => getRawString("Diagnostic.noneNotUsableWithAsync");
|
|
30725
30729
|
Diagnostic4.noneOperator = () => new ParameterizedString(getRawString("Diagnostic.noneOperator"));
|
|
30726
30730
|
Diagnostic4.noneUnknownMember = () => new ParameterizedString(getRawString("Diagnostic.noneUnknownMember"));
|
|
30731
|
+
Diagnostic4.nonLocalInModule = () => getRawString("Diagnostic.nonLocalInModule");
|
|
30727
30732
|
Diagnostic4.nonLocalNoBinding = () => new ParameterizedString(getRawString("Diagnostic.nonLocalNoBinding"));
|
|
30728
30733
|
Diagnostic4.nonLocalReassignment = () => new ParameterizedString(getRawString("Diagnostic.nonLocalReassignment"));
|
|
30729
30734
|
Diagnostic4.nonLocalRedefinition = () => new ParameterizedString(getRawString("Diagnostic.nonLocalRedefinition"));
|
|
30730
|
-
Diagnostic4.nonLocalInModule = () => getRawString("Diagnostic.nonLocalInModule");
|
|
30731
30735
|
Diagnostic4.noOverload = () => new ParameterizedString(getRawString("Diagnostic.noOverload"));
|
|
30736
|
+
Diagnostic4.nonlocalTypeParam = () => new ParameterizedString(getRawString("Diagnostic.nonlocalTypeParam"));
|
|
30732
30737
|
Diagnostic4.noReturnContainsReturn = () => getRawString("Diagnostic.noReturnContainsReturn");
|
|
30733
30738
|
Diagnostic4.noReturnContainsYield = () => getRawString("Diagnostic.noReturnContainsYield");
|
|
30734
30739
|
Diagnostic4.noReturnReturnsNone = () => getRawString("Diagnostic.noReturnReturnsNone");
|
|
@@ -42655,6 +42660,7 @@ var require_tokenizer = __commonJS({
|
|
|
42655
42660
|
}
|
|
42656
42661
|
}
|
|
42657
42662
|
_skipToEndOfStringLiteral(flags, inFormatSpecifier = false) {
|
|
42663
|
+
var _a;
|
|
42658
42664
|
const quoteChar = flags & 1 ? 39 : 34;
|
|
42659
42665
|
const isTriplicate = (flags & 4) !== 0;
|
|
42660
42666
|
const isFString = (flags & 64) !== 0;
|
|
@@ -42696,12 +42702,14 @@ var require_tokenizer = __commonJS({
|
|
|
42696
42702
|
}
|
|
42697
42703
|
}
|
|
42698
42704
|
} else if (this._cs.currentChar === 10 || this._cs.currentChar === 13) {
|
|
42699
|
-
if (!isTriplicate
|
|
42700
|
-
|
|
42701
|
-
|
|
42702
|
-
|
|
42703
|
-
|
|
42704
|
-
|
|
42705
|
+
if (!isTriplicate) {
|
|
42706
|
+
if (!isFString || !((_a = this._activeFString) == null ? void 0 : _a.activeReplacementField)) {
|
|
42707
|
+
flags |= 65536;
|
|
42708
|
+
return {
|
|
42709
|
+
escapedValue: getEscapedValue(),
|
|
42710
|
+
flags
|
|
42711
|
+
};
|
|
42712
|
+
}
|
|
42705
42713
|
}
|
|
42706
42714
|
if (this._cs.currentChar === 13 && this._cs.nextChar === 10) {
|
|
42707
42715
|
escapedValueLength++;
|
|
@@ -44325,6 +44333,7 @@ var require_binder = __commonJS({
|
|
|
44325
44333
|
/* unbound */
|
|
44326
44334
|
false
|
|
44327
44335
|
);
|
|
44336
|
+
this._addInferredTypeAssignmentForVariable(node.d.destExpr, node.d.rightExpr);
|
|
44328
44337
|
if (node.d.operator === 1 && this._currentScope.type === 4 && node.d.leftExpr.nodeType === 38 && node.d.leftExpr.d.value === "__all__") {
|
|
44329
44338
|
const expr = node.d.rightExpr;
|
|
44330
44339
|
let emitDunderAllWarning = true;
|
|
@@ -49728,6 +49737,7 @@ var require_typeUtils = __commonJS({
|
|
|
49728
49737
|
MemberAccessFlags2[MemberAccessFlags2["SkipAttributeAccessOverride"] = 512] = "SkipAttributeAccessOverride";
|
|
49729
49738
|
MemberAccessFlags2[MemberAccessFlags2["DisallowGenericInstanceVariableAccess"] = 1024] = "DisallowGenericInstanceVariableAccess";
|
|
49730
49739
|
MemberAccessFlags2[MemberAccessFlags2["TypeExpression"] = 2048] = "TypeExpression";
|
|
49740
|
+
MemberAccessFlags2[MemberAccessFlags2["SkipTypedDictEntries"] = 4096] = "SkipTypedDictEntries";
|
|
49731
49741
|
})(MemberAccessFlags || (exports2.MemberAccessFlags = MemberAccessFlags = {}));
|
|
49732
49742
|
var ClassIteratorFlags;
|
|
49733
49743
|
(function(ClassIteratorFlags2) {
|
|
@@ -50762,6 +50772,7 @@ var require_typeUtils = __commonJS({
|
|
|
50762
50772
|
return (_b = memberItr.next()) == null ? void 0 : _b.value;
|
|
50763
50773
|
}
|
|
50764
50774
|
function* getClassMemberIterator(classType, memberName, flags = 0, skipMroClass) {
|
|
50775
|
+
var _a;
|
|
50765
50776
|
const declaredTypesOnly = (flags & 64) !== 0;
|
|
50766
50777
|
let skippedUndeclaredType = false;
|
|
50767
50778
|
if ((0, types_1.isClass)(classType)) {
|
|
@@ -50804,9 +50815,10 @@ var require_typeUtils = __commonJS({
|
|
|
50804
50815
|
continue;
|
|
50805
50816
|
}
|
|
50806
50817
|
const memberFields = types_1.ClassType.getSymbolTable(specializedMroClass);
|
|
50818
|
+
const skipTdEntry = (flags & 4096) !== 0 && ((_a = specializedMroClass.shared.typedDictEntries) == null ? void 0 : _a.knownItems.has(memberName));
|
|
50807
50819
|
if ((flags & 16) === 0) {
|
|
50808
50820
|
const symbol = memberFields.get(memberName);
|
|
50809
|
-
if (symbol && symbol.isInstanceMember()) {
|
|
50821
|
+
if (symbol && symbol.isInstanceMember() && !skipTdEntry) {
|
|
50810
50822
|
const hasDeclaredType = symbol.hasTypedDeclarations();
|
|
50811
50823
|
if (!declaredTypesOnly || hasDeclaredType) {
|
|
50812
50824
|
const cm = {
|
|
@@ -50828,7 +50840,7 @@ var require_typeUtils = __commonJS({
|
|
|
50828
50840
|
}
|
|
50829
50841
|
if ((flags & 32) === 0) {
|
|
50830
50842
|
let symbol = memberFields.get(memberName);
|
|
50831
|
-
if (symbol && symbol.isClassMember()) {
|
|
50843
|
+
if (symbol && symbol.isClassMember() && !skipTdEntry) {
|
|
50832
50844
|
const hasDeclaredType = symbol.hasTypedDeclarations();
|
|
50833
50845
|
if (!declaredTypesOnly || hasDeclaredType) {
|
|
50834
50846
|
let isInstanceMember = symbol.isInstanceMember();
|
|
@@ -55002,7 +55014,7 @@ var require_parameterUtils = __commonJS({
|
|
|
55002
55014
|
ParamKind2[ParamKind2["Keyword"] = 2] = "Keyword";
|
|
55003
55015
|
ParamKind2[ParamKind2["ExpandedArgs"] = 3] = "ExpandedArgs";
|
|
55004
55016
|
})(ParamKind || (exports2.ParamKind = ParamKind = {}));
|
|
55005
|
-
function getParamListDetails(type) {
|
|
55017
|
+
function getParamListDetails(type, options) {
|
|
55006
55018
|
const result = {
|
|
55007
55019
|
firstPositionOrKeywordIndex: 0,
|
|
55008
55020
|
positionParamCount: 0,
|
|
@@ -55062,7 +55074,7 @@ var require_parameterUtils = __commonJS({
|
|
|
55062
55074
|
}
|
|
55063
55075
|
};
|
|
55064
55076
|
type.shared.parameters.forEach((param, index) => {
|
|
55065
|
-
var _a, _b;
|
|
55077
|
+
var _a, _b, _c;
|
|
55066
55078
|
if (param.category === 1) {
|
|
55067
55079
|
const paramType = types_1.FunctionType.getParamType(type, index);
|
|
55068
55080
|
if (param.name && (0, types_1.isUnpackedClass)(paramType) && paramType.priv.tupleTypeArgs) {
|
|
@@ -55130,8 +55142,9 @@ var require_parameterUtils = __commonJS({
|
|
|
55130
55142
|
const defaultParamType = !entry.isRequired ? specializedParamType : void 0;
|
|
55131
55143
|
addVirtualParam(types_1.FunctionParam.create(0, specializedParamType, types_1.FunctionParamFlags.TypeDeclared, name, defaultParamType), index, specializedParamType, defaultParamType);
|
|
55132
55144
|
});
|
|
55133
|
-
|
|
55134
|
-
|
|
55145
|
+
const extraItemsType = ((_a = paramType.shared.typedDictEntries.extraItems) == null ? void 0 : _a.valueType) ?? types_1.AnyType.create();
|
|
55146
|
+
if (!(0, types_1.isNever)(extraItemsType) && !(options == null ? void 0 : options.disallowExtraKwargsForTd)) {
|
|
55147
|
+
addVirtualParam(types_1.FunctionParam.create(2, extraItemsType, types_1.FunctionParamFlags.TypeDeclared, "kwargs"), index, extraItemsType);
|
|
55135
55148
|
result.kwargsIndex = result.params.length - 1;
|
|
55136
55149
|
}
|
|
55137
55150
|
result.hasUnpackedTypedDict = true;
|
|
@@ -55154,7 +55167,7 @@ var require_parameterUtils = __commonJS({
|
|
|
55154
55167
|
index,
|
|
55155
55168
|
/* typeOverride */
|
|
55156
55169
|
void 0,
|
|
55157
|
-
((
|
|
55170
|
+
((_b = type.priv.specializedTypes) == null ? void 0 : _b.parameterDefaultTypes) ? (_c = type.priv.specializedTypes) == null ? void 0 : _c.parameterDefaultTypes[index] : void 0
|
|
55158
55171
|
);
|
|
55159
55172
|
}
|
|
55160
55173
|
});
|
|
@@ -55336,31 +55349,35 @@ var require_typedDicts = __commonJS({
|
|
|
55336
55349
|
}
|
|
55337
55350
|
if (usingDictSyntax) {
|
|
55338
55351
|
const argsToConsider = argList.slice(2);
|
|
55352
|
+
let sawClosedOrExtraItems = false;
|
|
55339
55353
|
for (const arg of argsToConsider) {
|
|
55340
55354
|
if (((_a = arg.name) == null ? void 0 : _a.d.value) === "total" || ((_b = arg.name) == null ? void 0 : _b.d.value) === "closed") {
|
|
55341
55355
|
if (!arg.valueExpression || arg.valueExpression.nodeType !== 14 || !(arg.valueExpression.d.constType === 15 || arg.valueExpression.d.constType === 33)) {
|
|
55342
55356
|
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.typedDictBoolParam().format({ name: arg.name.d.value }), arg.valueExpression || errorNode);
|
|
55343
55357
|
} else if (arg.name.d.value === "total" && arg.valueExpression.d.constType === 15) {
|
|
55344
55358
|
classType.shared.flags |= 32;
|
|
55345
|
-
} else if (arg.name.d.value === "closed"
|
|
55346
|
-
if (
|
|
55347
|
-
|
|
55359
|
+
} else if (arg.name.d.value === "closed") {
|
|
55360
|
+
if (arg.valueExpression.d.constType === 33) {
|
|
55361
|
+
if (AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.enableExperimentalFeatures) {
|
|
55362
|
+
classType.shared.flags |= 8 | 16;
|
|
55363
|
+
}
|
|
55364
|
+
}
|
|
55365
|
+
if (sawClosedOrExtraItems) {
|
|
55366
|
+
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.typedDictExtraItemsClosed(), arg.valueExpression || errorNode);
|
|
55348
55367
|
}
|
|
55368
|
+
sawClosedOrExtraItems = true;
|
|
55349
55369
|
}
|
|
55350
55370
|
} else if (((_c = arg.name) == null ? void 0 : _c.d.value) === "extra_items") {
|
|
55351
55371
|
classType.shared.typedDictExtraItemsExpr = arg.valueExpression;
|
|
55352
55372
|
classType.shared.flags |= 16;
|
|
55373
|
+
if (sawClosedOrExtraItems) {
|
|
55374
|
+
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.typedDictExtraItemsClosed(), arg.valueExpression || errorNode);
|
|
55375
|
+
}
|
|
55376
|
+
sawClosedOrExtraItems = true;
|
|
55353
55377
|
} else {
|
|
55354
55378
|
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportCallIssue, localize_1.LocMessage.typedDictExtraArgs(), arg.valueExpression || errorNode);
|
|
55355
55379
|
}
|
|
55356
55380
|
}
|
|
55357
|
-
if (types_1.ClassType.isTypedDictMarkedClosed(classType) && classType.shared.typedDictExtraItemsExpr) {
|
|
55358
|
-
const arg = argsToConsider.find((arg2) => {
|
|
55359
|
-
var _a2;
|
|
55360
|
-
return ((_a2 = arg2.name) == null ? void 0 : _a2.d.value) === "extra_items";
|
|
55361
|
-
});
|
|
55362
|
-
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.typedDictExtraItemsClosed(), (arg == null ? void 0 : arg.valueExpression) ?? errorNode);
|
|
55363
|
-
}
|
|
55364
55381
|
}
|
|
55365
55382
|
synthesizeTypedDictClassMethods(evaluator, errorNode, classType);
|
|
55366
55383
|
if (((_d = errorNode.parent) == null ? void 0 : _d.nodeType) === 3 && className) {
|
|
@@ -55666,6 +55683,23 @@ var require_typedDicts = __commonJS({
|
|
|
55666
55683
|
true
|
|
55667
55684
|
));
|
|
55668
55685
|
}
|
|
55686
|
+
if (types_1.ClassType.isTypedDictEffectivelyClosed(classType)) {
|
|
55687
|
+
if (!(0, types_1.isNever)(extraEntriesInfo.valueType)) {
|
|
55688
|
+
popOverloads.push(...createPopMethods(
|
|
55689
|
+
strType,
|
|
55690
|
+
extraEntriesInfo.valueType,
|
|
55691
|
+
/* isEntryRequired */
|
|
55692
|
+
false
|
|
55693
|
+
));
|
|
55694
|
+
}
|
|
55695
|
+
} else {
|
|
55696
|
+
popOverloads.push(...createPopMethods(
|
|
55697
|
+
strType,
|
|
55698
|
+
evaluator.getObjectType(),
|
|
55699
|
+
/* isEntryRequired */
|
|
55700
|
+
false
|
|
55701
|
+
));
|
|
55702
|
+
}
|
|
55669
55703
|
symbolTable.set("get", symbol_1.Symbol.createWithType(4, types_1.OverloadedType.create(getOverloads)));
|
|
55670
55704
|
if (popOverloads.length > 0) {
|
|
55671
55705
|
symbolTable.set("pop", symbol_1.Symbol.createWithType(4, types_1.OverloadedType.create(popOverloads)));
|
|
@@ -67352,7 +67386,7 @@ var require_codeFlowEngine = __commonJS({
|
|
|
67352
67386
|
false
|
|
67353
67387
|
);
|
|
67354
67388
|
if (returnType) {
|
|
67355
|
-
if ((0, types_1.isClassInstance)(returnType) && types_1.ClassType.isBuiltIn(returnType, "Coroutine") && returnType.priv.typeArgs && returnType.priv.typeArgs.length >= 3) {
|
|
67389
|
+
if ((0, types_1.isClassInstance)(returnType) && types_1.ClassType.isBuiltIn(returnType, ["Coroutine", "CoroutineType"]) && returnType.priv.typeArgs && returnType.priv.typeArgs.length >= 3) {
|
|
67356
67390
|
if ((0, types_1.isNever)(returnType.priv.typeArgs[2]) && isCallAwaited) {
|
|
67357
67391
|
return true;
|
|
67358
67392
|
}
|
|
@@ -67411,7 +67445,7 @@ var require_codeFlowEngine = __commonJS({
|
|
|
67411
67445
|
if (exitType && (0, types_1.isFunction)(exitType) && exitType.shared.declaredReturnType) {
|
|
67412
67446
|
let returnType = exitType.shared.declaredReturnType;
|
|
67413
67447
|
if (isAsync) {
|
|
67414
|
-
if ((0, types_1.isClassInstance)(returnType) && types_1.ClassType.isBuiltIn(returnType, "Coroutine") && returnType.priv.typeArgs && returnType.priv.typeArgs.length >= 3) {
|
|
67448
|
+
if ((0, types_1.isClassInstance)(returnType) && types_1.ClassType.isBuiltIn(returnType, ["Coroutine", "CoroutineType"]) && returnType.priv.typeArgs && returnType.priv.typeArgs.length >= 3) {
|
|
67415
67449
|
returnType = returnType.priv.typeArgs[2];
|
|
67416
67450
|
}
|
|
67417
67451
|
}
|
|
@@ -70465,6 +70499,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
70465
70499
|
var constraintTracker_1 = require_constraintTracker();
|
|
70466
70500
|
var constructors_1 = require_constructors();
|
|
70467
70501
|
var dataClasses_1 = require_dataClasses();
|
|
70502
|
+
var declaration_1 = require_declaration();
|
|
70468
70503
|
var declarationUtils_1 = require_declarationUtils();
|
|
70469
70504
|
var decorators_1 = require_decorators();
|
|
70470
70505
|
var enums_1 = require_enums();
|
|
@@ -70519,7 +70554,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
70519
70554
|
var maxEntriesToUseForInference = 64;
|
|
70520
70555
|
var maxDeclarationsToUseForInference = 64;
|
|
70521
70556
|
var maxEffectiveTypeEvaluationAttempts = 16;
|
|
70522
|
-
var
|
|
70557
|
+
var maxTotalOverloadArgTypeExpansionCount = 256;
|
|
70558
|
+
var maxSingleOverloadArgTypeExpansionCount = 64;
|
|
70523
70559
|
var maxInferFunctionReturnRecursionCount = 12;
|
|
70524
70560
|
var maxRecursiveTypeAliasRecursionCount = 10;
|
|
70525
70561
|
var maxTypedDeclsPerSymbol = 16;
|
|
@@ -71680,7 +71716,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
71680
71716
|
usage,
|
|
71681
71717
|
/* diag */
|
|
71682
71718
|
void 0,
|
|
71683
|
-
flags | 512,
|
|
71719
|
+
flags | 512 | 4096,
|
|
71684
71720
|
objectType,
|
|
71685
71721
|
recursionCount
|
|
71686
71722
|
);
|
|
@@ -71697,7 +71733,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
71697
71733
|
}
|
|
71698
71734
|
let subDiag;
|
|
71699
71735
|
if (!skipObjectTypeLookup) {
|
|
71700
|
-
let effectiveFlags = flags;
|
|
71736
|
+
let effectiveFlags = flags | 4096;
|
|
71701
71737
|
if (objectTypeIsInstantiable) {
|
|
71702
71738
|
effectiveFlags |= 16 | 512 | 1024;
|
|
71703
71739
|
effectiveFlags &= ~32;
|
|
@@ -73159,12 +73195,10 @@ var require_typeEvaluator = __commonJS({
|
|
|
73159
73195
|
break;
|
|
73160
73196
|
}
|
|
73161
73197
|
case 56: {
|
|
73162
|
-
|
|
73163
|
-
|
|
73164
|
-
|
|
73165
|
-
|
|
73166
|
-
}, ignoreEmptyContainers, srcExpr);
|
|
73167
|
-
}
|
|
73198
|
+
assignTypeToExpression(target.d.expr, {
|
|
73199
|
+
type: getBuiltInObject(target.d.expr, "list", [typeResult.type]),
|
|
73200
|
+
isIncomplete: typeResult.isIncomplete
|
|
73201
|
+
}, srcExpr, ignoreEmptyContainers, allowAssignmentToFinalVar, expectedTypeDiagAddendum);
|
|
73168
73202
|
break;
|
|
73169
73203
|
}
|
|
73170
73204
|
case 0: {
|
|
@@ -76683,7 +76717,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
76683
76717
|
});
|
|
76684
76718
|
}
|
|
76685
76719
|
expandedArgTypes = expandArgTypes(contextFreeArgTypes, expandedArgTypes);
|
|
76686
|
-
if (!expandedArgTypes || expandedArgTypes.length >
|
|
76720
|
+
if (!expandedArgTypes || expandedArgTypes.length > maxTotalOverloadArgTypeExpansionCount) {
|
|
76687
76721
|
break;
|
|
76688
76722
|
}
|
|
76689
76723
|
}
|
|
@@ -76736,11 +76770,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
76736
76770
|
(0, typeUtils_1.doForEachSubtype)(type, (subtype) => {
|
|
76737
76771
|
if ((0, types_1.isClassInstance)(subtype)) {
|
|
76738
76772
|
const expandedLiteralTypes = (0, typeGuards_1.enumerateLiteralsForType)(evaluatorInterface, subtype);
|
|
76739
|
-
if (expandedLiteralTypes) {
|
|
76773
|
+
if (expandedLiteralTypes && expandedLiteralTypes.length <= maxSingleOverloadArgTypeExpansionCount) {
|
|
76740
76774
|
(0, collectionUtils_1.appendArray)(expandedTypes, expandedLiteralTypes);
|
|
76741
76775
|
return;
|
|
76742
76776
|
}
|
|
76743
|
-
const expandedTuples = (0, tuples_1.expandTuple)(subtype,
|
|
76777
|
+
const expandedTuples = (0, tuples_1.expandTuple)(subtype, maxSingleOverloadArgTypeExpansionCount);
|
|
76744
76778
|
if (expandedTuples) {
|
|
76745
76779
|
(0, collectionUtils_1.appendArray)(expandedTypes, expandedTuples);
|
|
76746
76780
|
return;
|
|
@@ -77277,7 +77311,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77277
77311
|
function matchArgsToParams(errorNode, argList, typeResult, overloadIndex) {
|
|
77278
77312
|
var _a, _b;
|
|
77279
77313
|
const overload = typeResult.type;
|
|
77280
|
-
const paramDetails = (0, parameterUtils_1.getParamListDetails)(overload);
|
|
77314
|
+
const paramDetails = (0, parameterUtils_1.getParamListDetails)(overload, { disallowExtraKwargsForTd: true });
|
|
77281
77315
|
const paramSpec = types_1.FunctionType.getParamSpecFromArgsKwargs(overload);
|
|
77282
77316
|
let argIndex = 0;
|
|
77283
77317
|
let matchedUnpackedListOfUnknownLength = false;
|
|
@@ -77657,8 +77691,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
77657
77691
|
const kwargsParam = paramDetails.params[paramDetails.kwargsIndex];
|
|
77658
77692
|
validateArgTypeParams.push({
|
|
77659
77693
|
paramCategory: 2,
|
|
77660
|
-
paramType: kwargsParam.
|
|
77661
|
-
requiresTypeVarMatching: (0, typeUtils_1.requiresSpecialization)(kwargsParam.
|
|
77694
|
+
paramType: kwargsParam.type,
|
|
77695
|
+
requiresTypeVarMatching: (0, typeUtils_1.requiresSpecialization)(kwargsParam.type),
|
|
77662
77696
|
argument: {
|
|
77663
77697
|
argCategory: 2,
|
|
77664
77698
|
typeResult: { type: extraItemsType }
|
|
@@ -79951,7 +79985,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
79951
79985
|
if (generatorTypeArgs) {
|
|
79952
79986
|
return generatorTypeArgs.length >= 2 ? generatorTypeArgs[2] : types_1.UnknownType.create();
|
|
79953
79987
|
}
|
|
79954
|
-
if ((0, types_1.isClassInstance)(yieldFromSubtype) && types_1.ClassType.isBuiltIn(yieldFromSubtype, "Coroutine")) {
|
|
79988
|
+
if ((0, types_1.isClassInstance)(yieldFromSubtype) && types_1.ClassType.isBuiltIn(yieldFromSubtype, ["Coroutine", "CoroutineType"])) {
|
|
79955
79989
|
return types_1.UnknownType.create();
|
|
79956
79990
|
}
|
|
79957
79991
|
const iterableType = ((_a = getTypeOfIterable(
|
|
@@ -81759,6 +81793,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
81759
81793
|
if (fileInfo.isStubFile) {
|
|
81760
81794
|
exprFlags |= 4;
|
|
81761
81795
|
}
|
|
81796
|
+
let sawClosedOrExtraItems = false;
|
|
81762
81797
|
node.d.arguments.forEach((arg) => {
|
|
81763
81798
|
var _a, _b, _c;
|
|
81764
81799
|
if (arg.d.argCategory === 2) {
|
|
@@ -81891,13 +81926,19 @@ var require_typeEvaluator = __commonJS({
|
|
|
81891
81926
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.typedDictBoolParam().format({ name: arg.d.name.d.value }), arg.d.valueExpr);
|
|
81892
81927
|
} else if (arg.d.name.d.value === "total" && !constArgValue) {
|
|
81893
81928
|
classType.shared.flags |= 32;
|
|
81894
|
-
} else if (arg.d.name.d.value === "closed"
|
|
81895
|
-
if (
|
|
81896
|
-
|
|
81897
|
-
|
|
81898
|
-
|
|
81929
|
+
} else if (arg.d.name.d.value === "closed") {
|
|
81930
|
+
if (constArgValue) {
|
|
81931
|
+
if (AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.enableExperimentalFeatures) {
|
|
81932
|
+
classType.shared.flags |= 8 | 16;
|
|
81933
|
+
if (classType.shared.typedDictExtraItemsExpr) {
|
|
81934
|
+
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.typedDictExtraItemsClosed(), classType.shared.typedDictExtraItemsExpr);
|
|
81935
|
+
}
|
|
81899
81936
|
}
|
|
81900
81937
|
}
|
|
81938
|
+
if (sawClosedOrExtraItems) {
|
|
81939
|
+
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.typedDictExtraItemsClosed(), arg.d.valueExpr);
|
|
81940
|
+
}
|
|
81941
|
+
sawClosedOrExtraItems = true;
|
|
81901
81942
|
}
|
|
81902
81943
|
} else if (arg.d.name.d.value === "extra_items") {
|
|
81903
81944
|
if (AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.enableExperimentalFeatures) {
|
|
@@ -81907,6 +81948,10 @@ var require_typeEvaluator = __commonJS({
|
|
|
81907
81948
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.typedDictExtraItemsClosed(), classType.shared.typedDictExtraItemsExpr);
|
|
81908
81949
|
}
|
|
81909
81950
|
}
|
|
81951
|
+
if (sawClosedOrExtraItems) {
|
|
81952
|
+
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.typedDictExtraItemsClosed(), arg.d.valueExpr);
|
|
81953
|
+
}
|
|
81954
|
+
sawClosedOrExtraItems = true;
|
|
81910
81955
|
} else {
|
|
81911
81956
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.typedDictInitsubclassParameter().format({ name: arg.d.name.d.value }), arg);
|
|
81912
81957
|
}
|
|
@@ -83017,7 +83062,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
83017
83062
|
}
|
|
83018
83063
|
}
|
|
83019
83064
|
if (!awaitableReturnType || !isGenerator) {
|
|
83020
|
-
const awaitableType =
|
|
83065
|
+
const awaitableType = useCoroutine ? getTypesType(node, "CoroutineType") : getTypingType(node, "Awaitable");
|
|
83021
83066
|
if (awaitableType && (0, types_1.isInstantiableClass)(awaitableType)) {
|
|
83022
83067
|
awaitableReturnType = types_1.ClassType.cloneAsInstance(types_1.ClassType.specialize(awaitableType, useCoroutine ? [types_1.AnyType.create(), types_1.AnyType.create(), returnType] : [returnType]));
|
|
83023
83068
|
} else {
|
|
@@ -83122,7 +83167,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
83122
83167
|
if (yieldNode.nodeType === 61) {
|
|
83123
83168
|
isYieldResultUsed = true;
|
|
83124
83169
|
const iteratorTypeResult = getTypeOfExpression(yieldNode.d.expr);
|
|
83125
|
-
if ((0, types_1.isClassInstance)(iteratorTypeResult.type) && types_1.ClassType.isBuiltIn(iteratorTypeResult.type, "Coroutine")) {
|
|
83170
|
+
if ((0, types_1.isClassInstance)(iteratorTypeResult.type) && types_1.ClassType.isBuiltIn(iteratorTypeResult.type, ["Coroutine", "CoroutineType"])) {
|
|
83126
83171
|
const yieldType = iteratorTypeResult.type.priv.typeArgs && iteratorTypeResult.type.priv.typeArgs.length > 0 ? iteratorTypeResult.type.priv.typeArgs[0] : types_1.UnknownType.create();
|
|
83127
83172
|
inferredYieldTypes.push(yieldType);
|
|
83128
83173
|
useAwaitableGenerator = true;
|
|
@@ -85662,6 +85707,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
85662
85707
|
}
|
|
85663
85708
|
declsToConsider.push(resolvedDecl);
|
|
85664
85709
|
});
|
|
85710
|
+
if (declsToConsider.every((decl) => (0, declaration_1.isVariableDeclaration)(decl) && ParseTreeUtils.isNodeContainedWithinNodeType(
|
|
85711
|
+
decl.node,
|
|
85712
|
+
5
|
|
85713
|
+
/* ParseNodeType.AugmentedAssignment */
|
|
85714
|
+
))) {
|
|
85715
|
+
declsToConsider.splice(0);
|
|
85716
|
+
}
|
|
85665
85717
|
const result = getTypeOfSymbolForDecls(symbol, declsToConsider, effectiveTypeCacheKey);
|
|
85666
85718
|
result.includesVariableDecl = includesVariableDecl;
|
|
85667
85719
|
result.includesIllegalTypeAliasDecl = includesIllegalTypeAliasDecl;
|
|
@@ -87789,63 +87841,71 @@ var require_typeEvaluator = __commonJS({
|
|
|
87789
87841
|
}
|
|
87790
87842
|
if (srcStartOfNamed >= 0) {
|
|
87791
87843
|
srcParamDetails.params.forEach((srcParamInfo, index) => {
|
|
87792
|
-
if (index
|
|
87793
|
-
|
|
87794
|
-
|
|
87795
|
-
|
|
87796
|
-
|
|
87797
|
-
|
|
87798
|
-
|
|
87799
|
-
|
|
87800
|
-
|
|
87801
|
-
|
|
87802
|
-
|
|
87803
|
-
|
|
87804
|
-
|
|
87805
|
-
|
|
87806
|
-
|
|
87807
|
-
|
|
87808
|
-
|
|
87809
|
-
|
|
87810
|
-
|
|
87811
|
-
|
|
87812
|
-
|
|
87813
|
-
|
|
87814
|
-
|
|
87815
|
-
|
|
87816
|
-
|
|
87817
|
-
} else {
|
|
87818
|
-
const destParamType = destParamInfo.type;
|
|
87819
|
-
const specializedDestParamType = constraints ? solveAndApplyConstraints(destParamType, constraints) : destParamType;
|
|
87820
|
-
if (!assignParam(
|
|
87821
|
-
destParamInfo.type,
|
|
87822
|
-
srcParamType,
|
|
87823
|
-
/* paramIndex */
|
|
87824
|
-
void 0,
|
|
87825
|
-
paramDiag == null ? void 0 : paramDiag.createAddendum(),
|
|
87826
|
-
constraints,
|
|
87827
|
-
flags,
|
|
87828
|
-
recursionCount
|
|
87829
|
-
)) {
|
|
87830
|
-
if (paramDiag) {
|
|
87831
|
-
paramDiag.addMessage(localize_1.LocAddendum.namedParamTypeMismatch().format({
|
|
87832
|
-
name: srcParamInfo.param.name,
|
|
87833
|
-
sourceType: printType(specializedDestParamType),
|
|
87834
|
-
destType: printType(srcParamType)
|
|
87835
|
-
}));
|
|
87836
|
-
}
|
|
87837
|
-
canAssign = false;
|
|
87838
|
-
}
|
|
87839
|
-
if (destParamInfo.defaultType && !srcParamInfo.defaultType) {
|
|
87840
|
-
diag == null ? void 0 : diag.createAddendum().addMessage(localize_1.LocAddendum.functionParamDefaultMissing().format({
|
|
87841
|
-
name: srcParamInfo.param.name
|
|
87842
|
-
}));
|
|
87844
|
+
if (index < srcStartOfNamed) {
|
|
87845
|
+
return;
|
|
87846
|
+
}
|
|
87847
|
+
if (!srcParamInfo.param.name || srcParamInfo.param.category !== 0 || srcParamInfo.kind === parameterUtils_1.ParamKind.Positional) {
|
|
87848
|
+
return;
|
|
87849
|
+
}
|
|
87850
|
+
const destParamInfo = destParamMap.get(srcParamInfo.param.name);
|
|
87851
|
+
const paramDiag = diag == null ? void 0 : diag.createAddendum();
|
|
87852
|
+
const srcParamType = srcParamInfo.type;
|
|
87853
|
+
if (!destParamInfo) {
|
|
87854
|
+
if (destParamDetails.kwargsIndex === void 0 && !srcParamInfo.defaultType) {
|
|
87855
|
+
if (paramDiag) {
|
|
87856
|
+
paramDiag.addMessage(localize_1.LocAddendum.namedParamMissingInDest().format({
|
|
87857
|
+
name: srcParamInfo.param.name
|
|
87858
|
+
}));
|
|
87859
|
+
}
|
|
87860
|
+
canAssign = false;
|
|
87861
|
+
} else if (destParamDetails.kwargsIndex !== void 0) {
|
|
87862
|
+
if (!assignParam(destParamDetails.params[destParamDetails.kwargsIndex].type, srcParamType, destParamDetails.params[destParamDetails.kwargsIndex].index, diag == null ? void 0 : diag.createAddendum(), constraints, flags, recursionCount)) {
|
|
87863
|
+
canAssign = false;
|
|
87864
|
+
}
|
|
87865
|
+
} else if (srcParamInfo.defaultType) {
|
|
87866
|
+
const defaultArgType = srcParamInfo.defaultType ?? srcParamInfo.defaultType;
|
|
87867
|
+
if (defaultArgType && !assignType(srcParamInfo.type, defaultArgType, diag == null ? void 0 : diag.createAddendum(), constraints, flags, recursionCount)) {
|
|
87868
|
+
if ((flags & 32) === 0) {
|
|
87843
87869
|
canAssign = false;
|
|
87844
87870
|
}
|
|
87845
|
-
destParamMap.delete(srcParamInfo.param.name);
|
|
87846
87871
|
}
|
|
87847
87872
|
}
|
|
87873
|
+
return;
|
|
87848
87874
|
}
|
|
87875
|
+
if (srcParamInfo.defaultType && destParamInfo.defaultType) {
|
|
87876
|
+
if ((flags & 32) !== 0) {
|
|
87877
|
+
destParamMap.delete(srcParamInfo.param.name);
|
|
87878
|
+
return;
|
|
87879
|
+
}
|
|
87880
|
+
}
|
|
87881
|
+
const destParamType = destParamInfo.type;
|
|
87882
|
+
const specializedDestParamType = constraints ? solveAndApplyConstraints(destParamType, constraints) : destParamType;
|
|
87883
|
+
if (!assignParam(
|
|
87884
|
+
destParamInfo.type,
|
|
87885
|
+
srcParamType,
|
|
87886
|
+
/* paramIndex */
|
|
87887
|
+
void 0,
|
|
87888
|
+
paramDiag == null ? void 0 : paramDiag.createAddendum(),
|
|
87889
|
+
constraints,
|
|
87890
|
+
flags,
|
|
87891
|
+
recursionCount
|
|
87892
|
+
)) {
|
|
87893
|
+
if (paramDiag) {
|
|
87894
|
+
paramDiag.addMessage(localize_1.LocAddendum.namedParamTypeMismatch().format({
|
|
87895
|
+
name: srcParamInfo.param.name,
|
|
87896
|
+
sourceType: printType(specializedDestParamType),
|
|
87897
|
+
destType: printType(srcParamType)
|
|
87898
|
+
}));
|
|
87899
|
+
}
|
|
87900
|
+
canAssign = false;
|
|
87901
|
+
}
|
|
87902
|
+
if (destParamInfo.defaultType && !srcParamInfo.defaultType) {
|
|
87903
|
+
diag == null ? void 0 : diag.createAddendum().addMessage(localize_1.LocAddendum.functionParamDefaultMissing().format({
|
|
87904
|
+
name: srcParamInfo.param.name
|
|
87905
|
+
}));
|
|
87906
|
+
canAssign = false;
|
|
87907
|
+
}
|
|
87908
|
+
destParamMap.delete(srcParamInfo.param.name);
|
|
87849
87909
|
});
|
|
87850
87910
|
}
|
|
87851
87911
|
destParamMap.forEach((destParamInfo, paramName) => {
|
|
@@ -89390,7 +89450,7 @@ var require_checker = __commonJS({
|
|
|
89390
89450
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportUnusedCallResult, localize_1.LocMessage.unusedCallResult().format({
|
|
89391
89451
|
type: this._evaluator.printType(returnType)
|
|
89392
89452
|
}), node);
|
|
89393
|
-
if ((0, types_1.isClassInstance)(returnType) && types_1.ClassType.isBuiltIn(returnType, "Coroutine")) {
|
|
89453
|
+
if ((0, types_1.isClassInstance)(returnType) && types_1.ClassType.isBuiltIn(returnType, ["Coroutine", "CoroutineType"])) {
|
|
89394
89454
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportUnusedCoroutine, localize_1.LocMessage.unusedCoroutine(), node);
|
|
89395
89455
|
}
|
|
89396
89456
|
}
|
|
@@ -89548,7 +89608,7 @@ var require_checker = __commonJS({
|
|
|
89548
89608
|
const yieldFromType = this._evaluator.getType(node.d.expr) || types_1.UnknownType.create();
|
|
89549
89609
|
let yieldType;
|
|
89550
89610
|
let sendType;
|
|
89551
|
-
if ((0, types_1.isClassInstance)(yieldFromType) && types_1.ClassType.isBuiltIn(yieldFromType, "Coroutine")) {
|
|
89611
|
+
if ((0, types_1.isClassInstance)(yieldFromType) && types_1.ClassType.isBuiltIn(yieldFromType, ["Coroutine", "CoroutineType"])) {
|
|
89552
89612
|
yieldType = types_1.UnknownType.create();
|
|
89553
89613
|
} else {
|
|
89554
89614
|
yieldType = ((_a = this._evaluator.getTypeOfIterable(
|
|
@@ -89802,6 +89862,7 @@ var require_checker = __commonJS({
|
|
|
89802
89862
|
node.d.targets.forEach((name) => {
|
|
89803
89863
|
this._evaluator.getType(name);
|
|
89804
89864
|
this.walk(name);
|
|
89865
|
+
this._validateNonlocalTypeParam(name);
|
|
89805
89866
|
});
|
|
89806
89867
|
});
|
|
89807
89868
|
return false;
|
|
@@ -90067,7 +90128,7 @@ var require_checker = __commonJS({
|
|
|
90067
90128
|
if (!(0, types_1.isFunction)(subtype) && !(0, types_1.isOverloaded)(subtype)) {
|
|
90068
90129
|
isExprFunction = false;
|
|
90069
90130
|
}
|
|
90070
|
-
if (!(0, types_1.isClassInstance)(subtype) || !types_1.ClassType.isBuiltIn(subtype, "Coroutine")) {
|
|
90131
|
+
if (!(0, types_1.isClassInstance)(subtype) || !types_1.ClassType.isBuiltIn(subtype, ["Coroutine", "CoroutineType"])) {
|
|
90071
90132
|
isCoroutine = false;
|
|
90072
90133
|
}
|
|
90073
90134
|
});
|
|
@@ -90109,6 +90170,20 @@ var require_checker = __commonJS({
|
|
|
90109
90170
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportUnusedExpression, localize_1.LocMessage.unusedExpression(), node);
|
|
90110
90171
|
}
|
|
90111
90172
|
}
|
|
90173
|
+
// Verifies that the target of a nonlocal statement is not a PEP 695-style
|
|
90174
|
+
// TypeParameter. This situation results in a runtime exception.
|
|
90175
|
+
_validateNonlocalTypeParam(node) {
|
|
90176
|
+
const symbolWithScope = this._evaluator.lookUpSymbolRecursive(
|
|
90177
|
+
node,
|
|
90178
|
+
node.d.value,
|
|
90179
|
+
/* honorCodeFlow */
|
|
90180
|
+
false
|
|
90181
|
+
);
|
|
90182
|
+
if (!symbolWithScope || symbolWithScope.scope.type !== 0) {
|
|
90183
|
+
return;
|
|
90184
|
+
}
|
|
90185
|
+
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.nonlocalTypeParam().format({ name: node.d.value }), node);
|
|
90186
|
+
}
|
|
90112
90187
|
_validateExhaustiveMatch(node) {
|
|
90113
90188
|
if (this._fileInfo.diagnosticRuleSet.reportMatchNotExhaustive === "none") {
|
|
90114
90189
|
return;
|
|
@@ -90977,6 +91052,9 @@ var require_checker = __commonJS({
|
|
|
90977
91052
|
}
|
|
90978
91053
|
}
|
|
90979
91054
|
}
|
|
91055
|
+
if (!overloads.find((overload) => overload.shared.declaration === primaryDecl)) {
|
|
91056
|
+
return;
|
|
91057
|
+
}
|
|
90980
91058
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportNoOverloadImplementation, localize_1.LocMessage.overloadWithoutImplementation().format({
|
|
90981
91059
|
name: primaryDecl.node.d.name.d.value
|
|
90982
91060
|
}), primaryDecl.node.d.name);
|
|
@@ -99450,11 +99528,13 @@ var require_parser = __commonJS({
|
|
|
99450
99528
|
}
|
|
99451
99529
|
continue;
|
|
99452
99530
|
}
|
|
99453
|
-
if (
|
|
99454
|
-
|
|
99455
|
-
|
|
99456
|
-
|
|
99457
|
-
|
|
99531
|
+
if (nextToken.type !== 2) {
|
|
99532
|
+
if (this._consumeTokensUntilType([
|
|
99533
|
+
26
|
|
99534
|
+
/* TokenType.FStringEnd */
|
|
99535
|
+
])) {
|
|
99536
|
+
this._getNextToken();
|
|
99537
|
+
}
|
|
99458
99538
|
}
|
|
99459
99539
|
this._addSyntaxError(nextToken.type === 18 ? localize_1.LocMessage.formatStringBrace() : localize_1.LocMessage.stringUnterminated(), nextToken);
|
|
99460
99540
|
break;
|
|
@@ -115554,8 +115634,10 @@ var TestFrameworkWalker = class extends import_parseTreeWalker3.ParseTreeWalker
|
|
|
115554
115634
|
visitFunction(node) {
|
|
115555
115635
|
if (node.d.name.d.value.startsWith("test_")) {
|
|
115556
115636
|
if (node.parent && (0, import_parseTreeUtils2.printParseNodeType)(node.parent.nodeType) === "Suite") {
|
|
115557
|
-
|
|
115558
|
-
|
|
115637
|
+
let fullyQualifiedTestName = "";
|
|
115638
|
+
let currentNode = node;
|
|
115639
|
+
let parentSuiteNode = currentNode.parent;
|
|
115640
|
+
while (parentSuiteNode.parent && (0, import_parseTreeUtils2.printParseNodeType)(parentSuiteNode.parent.nodeType) === "Class") {
|
|
115559
115641
|
const classNode = parentSuiteNode.parent;
|
|
115560
115642
|
let combineString = void 0;
|
|
115561
115643
|
if (this.testFramework === "unittest") {
|
|
@@ -115563,12 +115645,15 @@ var TestFrameworkWalker = class extends import_parseTreeWalker3.ParseTreeWalker
|
|
|
115563
115645
|
} else if (this.testFramework === "pytest") {
|
|
115564
115646
|
combineString = "::";
|
|
115565
115647
|
}
|
|
115566
|
-
|
|
115567
|
-
|
|
115568
|
-
|
|
115569
|
-
endOffset: node.start + node.length - 1
|
|
115570
|
-
});
|
|
115648
|
+
fullyQualifiedTestName = classNode.d.name.d.value + combineString + fullyQualifiedTestName;
|
|
115649
|
+
currentNode = currentNode.parent.parent;
|
|
115650
|
+
parentSuiteNode = currentNode.parent;
|
|
115571
115651
|
}
|
|
115652
|
+
this.featureItems.push({
|
|
115653
|
+
value: fullyQualifiedTestName + node.d.name.d.value,
|
|
115654
|
+
startOffset: node.start,
|
|
115655
|
+
endOffset: node.start + node.length - 1
|
|
115656
|
+
});
|
|
115572
115657
|
} else {
|
|
115573
115658
|
if (this.testFramework === "pytest") {
|
|
115574
115659
|
this.featureItems.push({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coc-pyright",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.394",
|
|
4
4
|
"description": "Pyright extension for coc.nvim, static type checker for Python",
|
|
5
5
|
"author": "Heyward Fann <fannheyward@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@types/minimatch": "^5.1.2",
|
|
37
37
|
"@types/node": "16",
|
|
38
38
|
"@types/which": "^3.0.4",
|
|
39
|
-
"@zzzen/pyright-internal": "^1.2.0-dev.
|
|
39
|
+
"@zzzen/pyright-internal": "^1.2.0-dev.20250209",
|
|
40
40
|
"coc.nvim": "^0.0.83-next.18",
|
|
41
41
|
"diff-match-patch": "^1.0.5",
|
|
42
42
|
"esbuild": "^0.24.0",
|