@zzzen/pyright-internal 1.2.0-dev.20221225 → 1.2.0-dev.20230108
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 +5 -3
- package/dist/analyzer/binder.js.map +1 -1
- package/dist/analyzer/checker.js +17 -11
- package/dist/analyzer/checker.js.map +1 -1
- package/dist/analyzer/codeFlowEngine.d.ts +16 -1
- package/dist/analyzer/codeFlowEngine.js +36 -13
- package/dist/analyzer/codeFlowEngine.js.map +1 -1
- package/dist/analyzer/constraintSolver.js +30 -31
- package/dist/analyzer/constraintSolver.js.map +1 -1
- package/dist/analyzer/importResolver.d.ts +2 -1
- package/dist/analyzer/importResolver.js +18 -3
- package/dist/analyzer/importResolver.js.map +1 -1
- package/dist/analyzer/patternMatching.js +5 -4
- package/dist/analyzer/patternMatching.js.map +1 -1
- package/dist/analyzer/program.d.ts +1 -0
- package/dist/analyzer/program.js +52 -25
- package/dist/analyzer/program.js.map +1 -1
- package/dist/analyzer/regions.js +14 -5
- package/dist/analyzer/regions.js.map +1 -1
- package/dist/analyzer/sourceFile.d.ts +1 -1
- package/dist/analyzer/sourceFile.js +1 -0
- package/dist/analyzer/sourceFile.js.map +1 -1
- package/dist/analyzer/sourceMapper.d.ts +2 -2
- package/dist/analyzer/sourceMapper.js +14 -5
- package/dist/analyzer/sourceMapper.js.map +1 -1
- package/dist/analyzer/typeCacheUtils.d.ts +26 -0
- package/dist/analyzer/{typeCache.js → typeCacheUtils.js} +9 -19
- package/dist/analyzer/typeCacheUtils.js.map +1 -0
- package/dist/analyzer/typeDocStringUtils.d.ts +2 -1
- package/dist/analyzer/typeDocStringUtils.js +18 -7
- package/dist/analyzer/typeDocStringUtils.js.map +1 -1
- package/dist/analyzer/typeEvaluator.js +551 -379
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeEvaluatorTypes.d.ts +2 -1
- package/dist/analyzer/typeGuards.d.ts +5 -1
- package/dist/analyzer/typeGuards.js +181 -45
- package/dist/analyzer/typeGuards.js.map +1 -1
- package/dist/analyzer/typeUtils.d.ts +13 -3
- package/dist/analyzer/typeUtils.js +288 -135
- package/dist/analyzer/typeUtils.js.map +1 -1
- package/dist/analyzer/typeVarContext.d.ts +2 -10
- package/dist/analyzer/typeVarContext.js +12 -31
- package/dist/analyzer/typeVarContext.js.map +1 -1
- package/dist/analyzer/types.d.ts +4 -12
- package/dist/analyzer/types.js +22 -22
- package/dist/analyzer/types.js.map +1 -1
- package/dist/commands/dumpFileDebugInfoCommand.js +2 -2
- package/dist/commands/dumpFileDebugInfoCommand.js.map +1 -1
- package/dist/commands/quickActionCommand.js +1 -1
- package/dist/commands/quickActionCommand.js.map +1 -1
- package/dist/common/collectionUtils.d.ts +1 -0
- package/dist/common/collectionUtils.js +9 -1
- package/dist/common/collectionUtils.js.map +1 -1
- package/dist/common/textEditUtils.d.ts +3 -2
- package/dist/common/textEditUtils.js +11 -10
- package/dist/common/textEditUtils.js.map +1 -1
- package/dist/languageServerBase.d.ts +1 -1
- package/dist/languageService/completionProvider.d.ts +3 -0
- package/dist/languageService/completionProvider.js +212 -159
- package/dist/languageService/completionProvider.js.map +1 -1
- package/dist/languageService/hoverProvider.d.ts +0 -1
- package/dist/languageService/hoverProvider.js +7 -20
- package/dist/languageService/hoverProvider.js.map +1 -1
- package/dist/languageService/indentationUtils.js +1 -1
- package/dist/languageService/indentationUtils.js.map +1 -1
- package/dist/languageService/tooltipUtils.d.ts +5 -1
- package/dist/languageService/tooltipUtils.js +28 -4
- package/dist/languageService/tooltipUtils.js.map +1 -1
- package/dist/localization/localize.d.ts +18 -3
- package/dist/localization/localize.js +7 -1
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.en-us.json +7 -1
- package/dist/parser/parser.js +3 -1
- package/dist/parser/parser.js.map +1 -1
- package/dist/tests/completions.test.d.ts +1 -0
- package/dist/tests/completions.test.js +331 -0
- package/dist/tests/completions.test.js.map +1 -0
- package/dist/tests/filesystem.test.js +11 -0
- package/dist/tests/filesystem.test.js.map +1 -1
- package/dist/tests/harness/fourslash/testState.js +1 -1
- package/dist/tests/harness/fourslash/testState.js.map +1 -1
- package/dist/tests/harness/vfs/filesystem.d.ts +2 -2
- package/dist/tests/harness/vfs/filesystem.js +5 -1
- package/dist/tests/harness/vfs/filesystem.js.map +1 -1
- package/dist/tests/hoverProvider.test.d.ts +1 -0
- package/dist/tests/hoverProvider.test.js +247 -0
- package/dist/tests/hoverProvider.test.js.map +1 -0
- package/dist/tests/indentationUtils.ptvs.test.js +1 -1
- package/dist/tests/indentationUtils.test.js +4 -4
- package/dist/tests/typeEvaluator1.test.js +16 -0
- package/dist/tests/typeEvaluator1.test.js.map +1 -1
- package/dist/tests/typeEvaluator2.test.js +6 -2
- package/dist/tests/typeEvaluator2.test.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +9 -1
- package/dist/tests/typeEvaluator3.test.js.map +1 -1
- package/dist/tests/typeEvaluator4.test.js +8 -0
- package/dist/tests/typeEvaluator4.test.js.map +1 -1
- package/dist/tests/typeEvaluator5.test.js +54 -6
- package/dist/tests/typeEvaluator5.test.js.map +1 -1
- package/dist/workspaceMap.js +1 -3
- package/dist/workspaceMap.js.map +1 -1
- package/package.json +6 -6
- package/dist/analyzer/typeCache.d.ts +0 -40
- package/dist/analyzer/typeCache.js.map +0 -1
@@ -260,8 +260,10 @@
|
|
260
260
|
"namedTupleNoTypes": "\"namedtuple\" provides no types for tuple entries; use \"NamedTuple\" instead",
|
261
261
|
"namedTupleSecondArg": "Expected named tuple entry list as second argument",
|
262
262
|
"newClsParam": "__new__ override should take a \"cls\" parameter",
|
263
|
+
"newTypeBadName": "The first argument to NewType must be a string literal",
|
263
264
|
"newTypeLiteral": "NewType cannot be used with Literal type",
|
264
265
|
"newTypeNotAClass": "Expected class as second argument to NewType",
|
266
|
+
"newTypeParamCount": "NewType requires two positional arguments",
|
265
267
|
"newTypeProtocolClass": "NewType cannot be used with protocol class",
|
266
268
|
"nonDefaultAfterDefault": "Non-default argument follows default argument",
|
267
269
|
"noneNotCallable": "Object of type \"None\" cannot be called",
|
@@ -312,6 +314,7 @@
|
|
312
314
|
"paramSpecKwargsUsage": "\"kwargs\" member of ParamSpec is valid only when used with **kwargs parameter",
|
313
315
|
"paramSpecNotBound": "Param spec \"{type}\" has no bound value",
|
314
316
|
"paramSpecNotUsedByOuterScope": "ParamSpec \"{name}\" has no meaning in this context",
|
317
|
+
"paramSpecScopedToReturnType": "ParamSpec \"{name}\" is scoped to a callable within the return type and cannot be referenced in the function body",
|
315
318
|
"paramSpecUnknownArg": "ParamSpec does not support more than one argument",
|
316
319
|
"paramSpecUnknownMember": "\"{name}\" is not a known member of ParamSpec",
|
317
320
|
"paramSpecUnknownParam": "\"{name}\" is unknown parameter to ParamSpec",
|
@@ -441,7 +444,6 @@
|
|
441
444
|
"typeParameterExistingTypeParameter": "Type parameter \"{name}\" is already in use",
|
442
445
|
"typeParametersMissing": "At least one type parameter must be specified",
|
443
446
|
"typeParameterNotDeclared": "Type parameter \"{name}\" is not included in the type parameter list for \"{container}\"",
|
444
|
-
"typeParameterOutOfScope": "Type parameter \"{name}\" has no meaning in this context",
|
445
447
|
"typePartiallyUnknown": "Type of \"{name}\" is partially unknown",
|
446
448
|
"typeUnknown": "Type of \"{name}\" is unknown",
|
447
449
|
"typeVarAssignedName": "TypeVar must be assigned to a variable named \"{name}\"",
|
@@ -452,10 +454,12 @@
|
|
452
454
|
"typeVarDefaultBoundMismatch": "TypeVar default type must be a subtype of the bound type",
|
453
455
|
"typeVarDefaultConstraintMismatch": "TypeVar default type must be one of the constrained types",
|
454
456
|
"typeVarFirstArg": "Expected name of TypeVar as first argument",
|
457
|
+
"typeVarDefaultInvalidTypeVar": "Type parameter \"{name}\" has a default type that refers to one or more type variables that are out of scope",
|
455
458
|
"typeVarNoMember": "TypeVar \"{type}\" has no member \"{name}\"",
|
456
459
|
"typeVarNotSubscriptable": "TypeVar \"{type}\" is not subscriptable",
|
457
460
|
"typeVarNotUsedByOuterScope": "Type variable \"{name}\" has no meaning in this context",
|
458
461
|
"typeVarPossiblyUnsolvable": "Type variable \"{name}\" may go unsolved if caller supplies no argument for parameter \"{param}\"",
|
462
|
+
"typeVarScopedToReturnType": "Type variable \"{name}\" is scoped to a callable within the return type and cannot be referenced in the function body",
|
459
463
|
"typeVarSingleConstraint": "TypeVar must have at least two constrained types",
|
460
464
|
"typeVarsNotInGenericOrProtocol": "Generic[] or Protocol[] must include all type variables",
|
461
465
|
"typeVarTupleContext": "TypeVarTuple not allowed in this context",
|
@@ -466,6 +470,7 @@
|
|
466
470
|
"typeVarUsedByOuterScope": "TypeVar \"{name}\" is already in use by an outer scope",
|
467
471
|
"typeVarUsedOnlyOnce": "TypeVar \"{name}\" appears only once in generic function signature",
|
468
472
|
"typeVarVariance": "TypeVar cannot be both covariant and contravariant",
|
473
|
+
"typeVarWithoutDefault": "\"{name}\" cannot appear after \"{other}\" in type parameter list because it has no default type",
|
469
474
|
"unaccessedClass": "Class \"{name}\" is not accessed",
|
470
475
|
"unaccessedFunction": "Function \"{name}\" is not accessed",
|
471
476
|
"unaccessedImport": "Import \"{name}\" is not accessed",
|
@@ -644,6 +649,7 @@
|
|
644
649
|
"typeNotStringLiteral": "\"{type}\" is not a string literal",
|
645
650
|
"typeOfSymbol": "Type of \"{name}\" is \"{type}\"",
|
646
651
|
"typeUnsupported": "Type \"{type}\" is unsupported",
|
652
|
+
"typeVarDefaultOutOfScope": "Type variable \"{name}\" is not in scope",
|
647
653
|
"typeVarIsContravariant": "TypeVar \"{name}\" is contravariant",
|
648
654
|
"typeVarIsCovariant": "TypeVar \"{name}\" is covariant",
|
649
655
|
"typeVarIsInvariant": "TypeVar \"{name}\" is invariant",
|
package/dist/parser/parser.js
CHANGED
@@ -2851,7 +2851,9 @@ class Parser {
|
|
2851
2851
|
break;
|
2852
2852
|
}
|
2853
2853
|
if (nextTokenType !== 10 /* Colon */) {
|
2854
|
-
|
2854
|
+
// Python 3.10 and newer allow assignment expressions to be used inside of a subscript.
|
2855
|
+
const allowAssignmentExpression = this._parseOptions.isStubFile || this._getLanguageVersion() >= pythonVersion_1.PythonVersion.V3_10;
|
2856
|
+
sliceExpressions[sliceIndex] = this._parseTestExpression(allowAssignmentExpression);
|
2855
2857
|
}
|
2856
2858
|
sliceIndex++;
|
2857
2859
|
if (sliceIndex >= 3 || !this._consumeTokenIfType(10 /* Colon */)) {
|