@zzzen/pyright-internal 1.2.0-dev.20250126 → 1.2.0-dev.20250202
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/dist/analyzer/binder.js +17 -11
- package/dist/analyzer/binder.js.map +1 -1
- package/dist/analyzer/dataClasses.js +4 -4
- package/dist/analyzer/dataClasses.js.map +1 -1
- package/dist/analyzer/parseTreeUtils.d.ts +1 -0
- package/dist/analyzer/parseTreeUtils.js +14 -0
- package/dist/analyzer/parseTreeUtils.js.map +1 -1
- package/dist/analyzer/tuples.d.ts +1 -0
- package/dist/analyzer/tuples.js +34 -0
- package/dist/analyzer/tuples.js.map +1 -1
- package/dist/analyzer/typeEvaluator.js +86 -44
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/common/envVarUtils.js +4 -0
- package/dist/common/envVarUtils.js.map +1 -1
- package/dist/localization/package.nls.cs.json +8 -4
- package/dist/localization/package.nls.de.json +8 -4
- package/dist/localization/package.nls.es.json +8 -4
- package/dist/localization/package.nls.fr.json +8 -4
- package/dist/localization/package.nls.it.json +8 -4
- package/dist/localization/package.nls.ja.json +8 -4
- package/dist/localization/package.nls.ko.json +8 -4
- package/dist/localization/package.nls.pl.json +8 -4
- package/dist/localization/package.nls.pt-br.json +8 -4
- package/dist/localization/package.nls.qps-ploc.json +4 -0
- package/dist/localization/package.nls.ru.json +8 -4
- package/dist/localization/package.nls.tr.json +8 -4
- package/dist/localization/package.nls.zh-cn.json +8 -4
- package/dist/localization/package.nls.zh-tw.json +8 -4
- package/dist/tests/harness/fourslash/fourSlashTypes.d.ts +2 -1
- package/dist/tests/harness/fourslash/fourSlashTypes.js +2 -0
- package/dist/tests/harness/fourslash/fourSlashTypes.js.map +1 -1
- package/dist/tests/harness/fourslash/testState.js +7 -0
- package/dist/tests/harness/fourslash/testState.js.map +1 -1
- package/dist/tests/typeEvaluator4.test.js +5 -1
- package/dist/tests/typeEvaluator4.test.js.map +1 -1
- package/package.json +1 -1
package/dist/analyzer/binder.js
CHANGED
@@ -62,7 +62,7 @@ const symbolNameUtils_1 = require("./symbolNameUtils");
|
|
62
62
|
// amount to the complexity factor. Without this, the complexity
|
63
63
|
// calculation fails to take into account large numbers of non-cyclical
|
64
64
|
// flow nodes. This number is somewhat arbitrary and is tuned empirically.
|
65
|
-
const flowNodeComplexityContribution = 0.
|
65
|
+
const flowNodeComplexityContribution = 0.025;
|
66
66
|
class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
67
67
|
constructor(fileInfo, _moduleSymbolOnly = false) {
|
68
68
|
super();
|
@@ -3191,17 +3191,23 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
3191
3191
|
// a decorator that tells us otherwise.
|
3192
3192
|
isInstanceMember = true;
|
3193
3193
|
for (const decorator of methodNode.d.decorators) {
|
3194
|
+
let decoratorName;
|
3194
3195
|
if (decorator.d.expr.nodeType === 38 /* ParseNodeType.Name */) {
|
3195
|
-
|
3196
|
-
|
3197
|
-
|
3198
|
-
|
3199
|
-
|
3200
|
-
|
3201
|
-
|
3202
|
-
|
3203
|
-
|
3204
|
-
|
3196
|
+
decoratorName = decorator.d.expr.d.value;
|
3197
|
+
}
|
3198
|
+
else if (decorator.d.expr.nodeType === 35 /* ParseNodeType.MemberAccess */ &&
|
3199
|
+
decorator.d.expr.d.leftExpr.nodeType === 38 /* ParseNodeType.Name */ &&
|
3200
|
+
decorator.d.expr.d.leftExpr.d.value === 'builtins') {
|
3201
|
+
decoratorName = decorator.d.expr.d.member.d.value;
|
3202
|
+
}
|
3203
|
+
if (decoratorName === 'staticmethod') {
|
3204
|
+
// A static method doesn't have a "self" or "cls" parameter.
|
3205
|
+
return undefined;
|
3206
|
+
}
|
3207
|
+
else if (decoratorName === 'classmethod') {
|
3208
|
+
// A classmethod implies that the first parameter is "cls".
|
3209
|
+
isInstanceMember = false;
|
3210
|
+
break;
|
3205
3211
|
}
|
3206
3212
|
}
|
3207
3213
|
}
|