@zzzen/pyright-internal 1.2.0-dev.20220821 → 1.2.0-dev.20220911
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 +18 -25
- package/dist/analyzer/binder.js.map +1 -1
- package/dist/analyzer/checker.d.ts +1 -0
- package/dist/analyzer/checker.js +30 -0
- package/dist/analyzer/checker.js.map +1 -1
- package/dist/analyzer/importResolver.d.ts +6 -1
- package/dist/analyzer/importResolver.js +76 -28
- package/dist/analyzer/importResolver.js.map +1 -1
- package/dist/analyzer/parseTreeUtils.d.ts +1 -0
- package/dist/analyzer/parseTreeUtils.js +54 -7
- package/dist/analyzer/parseTreeUtils.js.map +1 -1
- package/dist/analyzer/patternMatching.js +10 -0
- package/dist/analyzer/patternMatching.js.map +1 -1
- package/dist/analyzer/program.d.ts +1 -0
- package/dist/analyzer/program.js +16 -2
- package/dist/analyzer/program.js.map +1 -1
- package/dist/analyzer/scope.js +5 -3
- package/dist/analyzer/scope.js.map +1 -1
- package/dist/analyzer/service.d.ts +1 -1
- package/dist/analyzer/service.js +21 -7
- package/dist/analyzer/service.js.map +1 -1
- package/dist/analyzer/sourceFile.d.ts +2 -1
- package/dist/analyzer/sourceFile.js +4 -3
- package/dist/analyzer/sourceFile.js.map +1 -1
- package/dist/analyzer/typeEvaluator.js +89 -47
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeGuards.js +6 -5
- package/dist/analyzer/typeGuards.js.map +1 -1
- package/dist/analyzer/typePrinter.d.ts +3 -3
- package/dist/analyzer/typePrinter.js +24 -20
- package/dist/analyzer/typePrinter.js.map +1 -1
- package/dist/analyzer/typeUtils.d.ts +1 -1
- package/dist/analyzer/typeUtils.js +2 -2
- package/dist/analyzer/typeUtils.js.map +1 -1
- package/dist/common/commandLineOptions.d.ts +2 -0
- package/dist/common/commandLineOptions.js +7 -0
- package/dist/common/commandLineOptions.js.map +1 -1
- package/dist/common/debug.js +7 -1
- package/dist/common/debug.js.map +1 -1
- package/dist/common/envVarUtils.d.ts +1 -0
- package/dist/common/envVarUtils.js +34 -0
- package/dist/common/envVarUtils.js.map +1 -0
- package/dist/common/realFileSystem.js +1 -1
- package/dist/common/realFileSystem.js.map +1 -1
- package/dist/languageServerBase.d.ts +4 -2
- package/dist/languageServerBase.js +22 -39
- package/dist/languageServerBase.js.map +1 -1
- package/dist/languageService/analyzerServiceExecutor.js +4 -1
- package/dist/languageService/analyzerServiceExecutor.js.map +1 -1
- package/dist/localization/localize.d.ts +5 -3
- package/dist/localization/localize.js +2 -1
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.en-us.json +2 -1
- package/dist/parser/parser.js +8 -0
- package/dist/parser/parser.js.map +1 -1
- package/dist/parser/tokenizer.js +2 -1
- package/dist/parser/tokenizer.js.map +1 -1
- package/dist/server.js +6 -5
- package/dist/server.js.map +1 -1
- package/dist/tests/checker.test.js +2 -2
- package/dist/tests/ipythonMode.test.js +118 -0
- package/dist/tests/ipythonMode.test.js.map +1 -1
- package/dist/tests/parseTreeUtils.test.js +8 -2
- package/dist/tests/parseTreeUtils.test.js.map +1 -1
- package/dist/tests/typeEvaluator1.test.js +9 -1
- package/dist/tests/typeEvaluator1.test.js.map +1 -1
- package/dist/tests/typeEvaluator2.test.js +5 -1
- package/dist/tests/typeEvaluator2.test.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +7 -1
- package/dist/tests/typeEvaluator3.test.js.map +1 -1
- package/dist/tests/typeEvaluator4.test.js +4 -0
- package/dist/tests/typeEvaluator4.test.js.map +1 -1
- package/dist/tests/typeEvaluator5.test.js +2 -2
- package/package.json +5 -5
@@ -60,6 +60,7 @@
|
|
60
60
|
"classVarWithTypeVar": "\"ClassVar\" type cannot include type variables",
|
61
61
|
"clsSelfParamTypeMismatch": "Type of parameter \"{name}\" must be a supertype of its class \"{classType}\"",
|
62
62
|
"codeTooComplexToAnalyze": "Code is too complex to analyze; reduce complexity by refactoring into subroutines or reducing conditional code paths",
|
63
|
+
"collectionAliasInstantiation": "Type \"{type}\" cannot be instantiated, use \"{alias}\" instead",
|
63
64
|
"comparisonAlwaysFalse": "Condition will always evaluate to False since the types \"{leftType}\" and \"{rightType}\" have no overlap",
|
64
65
|
"comparisonAlwaysTrue": "Condition will always evaluate to True since the types \"{leftType}\" and \"{rightType}\" have no overlap",
|
65
66
|
"comprehensionInDict": "Comprehension cannot be used with other dictionary entries",
|
@@ -220,6 +221,7 @@
|
|
220
221
|
"keyValueInSet": "Key/value pairs are not allowed within a set",
|
221
222
|
"keywordArgInTypeArgument": "Keyword arguments cannot be used in type argument lists",
|
222
223
|
"keywordOnlyAfterArgs": "Keyword-only argument separator not allowed after \"*\" parameter",
|
224
|
+
"keywordParameterMissing": "One or more keyword parameters must follow \"*\" parameter",
|
223
225
|
"keywordSubscriptIllegal": "Keyword arguments within subscripts are not supported",
|
224
226
|
"lambdaReturnTypeUnknown": "Return type of lambda is unknown",
|
225
227
|
"lambdaReturnTypePartiallyUnknown": "Return type of lambda, \"{returnType}\", is partially unknown",
|
@@ -294,7 +296,6 @@
|
|
294
296
|
"overloadReturnTypeMismatch": "Overload {prevIndex} for \"{name}\" overlaps overload {newIndex} and returns an incompatible type",
|
295
297
|
"overloadWithImplementation": "\"{name}\" is marked as overload, but it includes an implementation",
|
296
298
|
"overloadWithoutImplementation": "\"{name}\" is marked as overload, but no implementation is provided",
|
297
|
-
"overwriteTypeParameter": "Cannot overwrite type parameter \"{name}\"",
|
298
299
|
"paramAfterKwargsParam": "Parameter cannot follow \"**\" parameter",
|
299
300
|
"paramAlreadyAssigned": "Parameter \"{name}\" is already assigned",
|
300
301
|
"paramAnnotationMissing": "Type annotation is missing for parameter \"{name}\"",
|
package/dist/parser/parser.js
CHANGED
@@ -1408,6 +1408,7 @@ class Parser {
|
|
1408
1408
|
let reportedNonDefaultParamErr = false;
|
1409
1409
|
let sawKeywordOnlySeparator = false;
|
1410
1410
|
let sawPositionOnlySeparator = false;
|
1411
|
+
let sawKeywordOnlyParamAfterSeparator = false;
|
1411
1412
|
let sawArgs = false;
|
1412
1413
|
let sawKwArgs = false;
|
1413
1414
|
while (true) {
|
@@ -1447,6 +1448,9 @@ class Parser {
|
|
1447
1448
|
sawPositionOnlySeparator = true;
|
1448
1449
|
}
|
1449
1450
|
else {
|
1451
|
+
if (sawKeywordOnlySeparator) {
|
1452
|
+
sawKeywordOnlyParamAfterSeparator = true;
|
1453
|
+
}
|
1450
1454
|
if (param.defaultValue) {
|
1451
1455
|
sawDefaultParam = true;
|
1452
1456
|
}
|
@@ -1482,6 +1486,10 @@ class Parser {
|
|
1482
1486
|
this._addError(localize_1.Localizer.Diagnostic.duplicateKwargsParam(), param);
|
1483
1487
|
}
|
1484
1488
|
sawKwArgs = true;
|
1489
|
+
// A **kwargs cannot immediately follow a keyword-only separator ("*").
|
1490
|
+
if (sawKeywordOnlySeparator && !sawKeywordOnlyParamAfterSeparator) {
|
1491
|
+
this._addError(localize_1.Localizer.Diagnostic.keywordParameterMissing(), param);
|
1492
|
+
}
|
1485
1493
|
}
|
1486
1494
|
else if (sawKwArgs) {
|
1487
1495
|
this._addError(localize_1.Localizer.Diagnostic.paramAfterKwargsParam(), param);
|