@zzzen/pyright-internal 1.2.0-dev.20240114 → 1.2.0-dev.20240128
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.d.ts +1 -3
- package/dist/analyzer/binder.js +27 -37
- package/dist/analyzer/binder.js.map +1 -1
- package/dist/analyzer/checker.d.ts +1 -3
- package/dist/analyzer/checker.js +325 -381
- package/dist/analyzer/checker.js.map +1 -1
- package/dist/analyzer/commentUtils.js +7 -7
- package/dist/analyzer/commentUtils.js.map +1 -1
- package/dist/analyzer/constraintSolver.js +23 -30
- package/dist/analyzer/constraintSolver.js.map +1 -1
- package/dist/analyzer/constructorTransform.js +10 -11
- package/dist/analyzer/constructorTransform.js.map +1 -1
- package/dist/analyzer/constructors.d.ts +3 -3
- package/dist/analyzer/constructors.js +12 -14
- package/dist/analyzer/constructors.js.map +1 -1
- package/dist/analyzer/dataClasses.js +15 -15
- package/dist/analyzer/dataClasses.js.map +1 -1
- package/dist/analyzer/decorators.d.ts +1 -2
- package/dist/analyzer/decorators.js +4 -1
- package/dist/analyzer/decorators.js.map +1 -1
- package/dist/analyzer/enums.d.ts +4 -2
- package/dist/analyzer/enums.js +99 -50
- package/dist/analyzer/enums.js.map +1 -1
- package/dist/analyzer/functionTransform.js +1 -2
- package/dist/analyzer/functionTransform.js.map +1 -1
- package/dist/analyzer/importResolver.js +3 -3
- package/dist/analyzer/namedTuples.js +8 -7
- package/dist/analyzer/namedTuples.js.map +1 -1
- package/dist/analyzer/operations.js +16 -19
- package/dist/analyzer/operations.js.map +1 -1
- package/dist/analyzer/parseTreeUtils.d.ts +1 -1
- package/dist/analyzer/parseTreeUtils.js.map +1 -1
- package/dist/analyzer/patternMatching.js +22 -19
- package/dist/analyzer/patternMatching.js.map +1 -1
- package/dist/analyzer/program.js +17 -3
- package/dist/analyzer/program.js.map +1 -1
- package/dist/analyzer/properties.js +8 -8
- package/dist/analyzer/properties.js.map +1 -1
- package/dist/analyzer/protocols.js +14 -14
- package/dist/analyzer/protocols.js.map +1 -1
- package/dist/analyzer/service.js +14 -14
- package/dist/analyzer/service.js.map +1 -1
- package/dist/analyzer/sourceFile.js +12 -12
- package/dist/analyzer/sourceFile.js.map +1 -1
- package/dist/analyzer/typeEvaluator.js +839 -762
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeEvaluatorTypes.d.ts +8 -8
- package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
- package/dist/analyzer/typeGuards.js +2 -2
- package/dist/analyzer/typeGuards.js.map +1 -1
- package/dist/analyzer/typePrinter.js +3 -4
- package/dist/analyzer/typePrinter.js.map +1 -1
- package/dist/analyzer/typeUtils.d.ts +4 -2
- package/dist/analyzer/typeUtils.js +13 -6
- package/dist/analyzer/typeUtils.js.map +1 -1
- package/dist/analyzer/typedDicts.js +30 -34
- package/dist/analyzer/typedDicts.js.map +1 -1
- package/dist/analyzer/types.d.ts +5 -10
- package/dist/analyzer/types.js +12 -39
- package/dist/analyzer/types.js.map +1 -1
- package/dist/backgroundThreadBase.js +4 -4
- package/dist/backgroundThreadBase.js.map +1 -1
- package/dist/common/commandLineOptions.d.ts +1 -0
- package/dist/common/commandLineOptions.js.map +1 -1
- package/dist/common/configOptions.d.ts +17 -0
- package/dist/common/configOptions.js +93 -11
- package/dist/common/configOptions.js.map +1 -1
- package/dist/common/core.d.ts +1 -1
- package/dist/common/core.js.map +1 -1
- package/dist/common/diagnosticRules.d.ts +16 -0
- package/dist/common/diagnosticRules.js +16 -0
- package/dist/common/diagnosticRules.js.map +1 -1
- package/dist/common/uri/baseUri.d.ts +7 -2
- package/dist/common/uri/baseUri.js +47 -24
- package/dist/common/uri/baseUri.js.map +1 -1
- package/dist/common/uri/emptyUri.d.ts +6 -4
- package/dist/common/uri/emptyUri.js +14 -9
- package/dist/common/uri/emptyUri.js.map +1 -1
- package/dist/common/uri/fileUri.d.ts +12 -4
- package/dist/common/uri/fileUri.js +59 -9
- package/dist/common/uri/fileUri.js.map +1 -1
- package/dist/common/uri/uri.d.ts +5 -1
- package/dist/common/uri/uri.js.map +1 -1
- package/dist/common/uri/uriUtils.js +3 -3
- package/dist/common/uri/webUri.d.ts +6 -1
- package/dist/common/uri/webUri.js +52 -12
- package/dist/common/uri/webUri.js.map +1 -1
- package/dist/languageServerBase.d.ts +1 -0
- package/dist/languageServerBase.js +1 -0
- package/dist/languageServerBase.js.map +1 -1
- package/dist/languageService/analyzerServiceExecutor.js +2 -0
- package/dist/languageService/analyzerServiceExecutor.js.map +1 -1
- package/dist/languageService/completionProvider.js.map +1 -1
- package/dist/localization/localize.d.ts +4 -5
- package/dist/localization/localize.js +5 -3
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.cs.json +34 -8
- package/dist/localization/package.nls.de.json +34 -8
- package/dist/localization/package.nls.en-us.json +7 -7
- package/dist/localization/package.nls.es.json +34 -8
- package/dist/localization/package.nls.fr.json +34 -8
- package/dist/localization/package.nls.it.json +34 -8
- package/dist/localization/package.nls.ja.json +34 -8
- package/dist/localization/package.nls.ko.json +34 -8
- package/dist/localization/package.nls.pl.json +34 -8
- package/dist/localization/package.nls.pt-br.json +34 -8
- package/dist/localization/package.nls.qps-ploc.json +32 -6
- package/dist/localization/package.nls.ru.json +34 -8
- package/dist/localization/package.nls.tr.json +34 -8
- package/dist/localization/package.nls.zh-cn.json +34 -8
- package/dist/localization/package.nls.zh-tw.json +34 -8
- package/dist/parser/parser.d.ts +1 -1
- package/dist/parser/parser.js +201 -201
- package/dist/parser/parser.js.map +1 -1
- package/dist/pyright.js +13 -11
- package/dist/pyright.js.map +1 -1
- package/dist/pyrightFileSystem.js +2 -2
- package/dist/server.js +7 -5
- package/dist/server.js.map +1 -1
- package/dist/tests/config.test.js +4 -4
- package/dist/tests/filesystem.test.js +2 -2
- package/dist/tests/fourSlashParser.test.js +1 -1
- package/dist/tests/harness/fourslash/testLanguageService.js +2 -0
- package/dist/tests/harness/fourslash/testLanguageService.js.map +1 -1
- package/dist/tests/harness/fourslash/testState.js +1 -0
- package/dist/tests/harness/fourslash/testState.js.map +1 -1
- package/dist/tests/ipythonMode.test.js +10 -10
- package/dist/tests/ipythonMode.test.js.map +1 -1
- package/dist/tests/localizer.test.js +2 -2
- package/dist/tests/localizer.test.js.map +1 -1
- package/dist/tests/typeEvaluator1.test.js +6 -6
- package/dist/tests/typeEvaluator2.test.js +8 -4
- package/dist/tests/typeEvaluator2.test.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +17 -5
- package/dist/tests/typeEvaluator3.test.js.map +1 -1
- package/dist/tests/typeEvaluator4.test.js +3 -3
- package/dist/tests/typeEvaluator5.test.js +4 -0
- package/dist/tests/typeEvaluator5.test.js.map +1 -1
- package/dist/tests/uri.test.js +65 -8
- package/dist/tests/uri.test.js.map +1 -1
- package/dist/workspaceFactory.d.ts +1 -0
- package/dist/workspaceFactory.js +1 -0
- package/dist/workspaceFactory.js.map +1 -1
- package/package.json +1 -1
@@ -137,9 +137,7 @@ export declare class Binder extends ParseTreeWalker {
|
|
137
137
|
private _bindYield;
|
138
138
|
private _getUniqueFlowNodeId;
|
139
139
|
private _addDiagnostic;
|
140
|
-
private
|
141
|
-
private _addWarning;
|
142
|
-
private _addInformation;
|
140
|
+
private _addSyntaxError;
|
143
141
|
}
|
144
142
|
export declare class YieldFinder extends ParseTreeWalker {
|
145
143
|
private _containsYield;
|
package/dist/analyzer/binder.js
CHANGED
@@ -198,7 +198,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
198
198
|
return true;
|
199
199
|
}
|
200
200
|
if (!importResult.isImportFound) {
|
201
|
-
this._addDiagnostic(this._fileInfo.diagnosticRuleSet.reportMissingImports, diagnosticRules_1.DiagnosticRule.reportMissingImports, localize_1.
|
201
|
+
this._addDiagnostic(this._fileInfo.diagnosticRuleSet.reportMissingImports, diagnosticRules_1.DiagnosticRule.reportMissingImports, localize_1.LocMessage.importResolveFailure().format({
|
202
202
|
importName: importResult.importName,
|
203
203
|
venv: this._fileInfo.executionEnvironment.name,
|
204
204
|
}), node);
|
@@ -208,7 +208,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
208
208
|
if (!importResult.isStubFile &&
|
209
209
|
importResult.importType === 1 /* ImportType.ThirdParty */ &&
|
210
210
|
!importResult.pyTypedInfo) {
|
211
|
-
const diagnostic = this._addDiagnostic(this._fileInfo.diagnosticRuleSet.reportMissingTypeStubs, diagnosticRules_1.DiagnosticRule.reportMissingTypeStubs, localize_1.
|
211
|
+
const diagnostic = this._addDiagnostic(this._fileInfo.diagnosticRuleSet.reportMissingTypeStubs, diagnosticRules_1.DiagnosticRule.reportMissingTypeStubs, localize_1.LocMessage.stubFileMissing().format({ importName: importResult.importName }), node);
|
212
212
|
if (diagnostic) {
|
213
213
|
// Add a diagnostic action for resolving this diagnostic.
|
214
214
|
const createTypeStubAction = {
|
@@ -496,7 +496,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
496
496
|
}
|
497
497
|
if (emitDunderAllWarning) {
|
498
498
|
this._usesUnsupportedDunderAllForm = true;
|
499
|
-
this._addDiagnostic(this._fileInfo.diagnosticRuleSet.reportUnsupportedDunderAll, diagnosticRules_1.DiagnosticRule.reportUnsupportedDunderAll, localize_1.
|
499
|
+
this._addDiagnostic(this._fileInfo.diagnosticRuleSet.reportUnsupportedDunderAll, diagnosticRules_1.DiagnosticRule.reportUnsupportedDunderAll, localize_1.LocMessage.unsupportedDunderAllOperation(), node);
|
500
500
|
}
|
501
501
|
}
|
502
502
|
return false;
|
@@ -522,7 +522,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
522
522
|
AnalyzerNodeInfo.setDeclaration(name, paramDeclaration);
|
523
523
|
AnalyzerNodeInfo.setTypeParameterSymbol(name, symbol);
|
524
524
|
if (this._activeTypeParams.has(name.value)) {
|
525
|
-
this.
|
525
|
+
this._addSyntaxError(localize_1.LocMessage.typeParameterExistingTypeParameter().format({ name: name.value }), name);
|
526
526
|
}
|
527
527
|
else {
|
528
528
|
this._activeTypeParams.set(name.value, { symbol, scope: this._currentScope });
|
@@ -573,7 +573,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
573
573
|
this._addTypeDeclarationForVariable(node.leftExpression, node.typeAnnotationComment);
|
574
574
|
}
|
575
575
|
if (node.chainedTypeAnnotationComment) {
|
576
|
-
this._addDiagnostic(this._fileInfo.diagnosticRuleSet.
|
576
|
+
this._addDiagnostic(this._fileInfo.diagnosticRuleSet.reportInvalidTypeForm, diagnosticRules_1.DiagnosticRule.reportInvalidTypeForm, localize_1.LocMessage.annotationNotSupported(), node.chainedTypeAnnotationComment);
|
577
577
|
}
|
578
578
|
// If the assignment target base expression is potentially a
|
579
579
|
// TypedDict, add the base expression to the flow expressions set
|
@@ -649,7 +649,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
649
649
|
}
|
650
650
|
if (emitDunderAllWarning) {
|
651
651
|
this._usesUnsupportedDunderAllForm = true;
|
652
|
-
this._addDiagnostic(this._fileInfo.diagnosticRuleSet.reportUnsupportedDunderAll, diagnosticRules_1.DiagnosticRule.reportUnsupportedDunderAll, localize_1.
|
652
|
+
this._addDiagnostic(this._fileInfo.diagnosticRuleSet.reportUnsupportedDunderAll, diagnosticRules_1.DiagnosticRule.reportUnsupportedDunderAll, localize_1.LocMessage.unsupportedDunderAllOperation(), node);
|
653
653
|
}
|
654
654
|
}
|
655
655
|
}
|
@@ -708,7 +708,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
708
708
|
});
|
709
709
|
const evaluationNode = ParseTreeUtils.getEvaluationNodeForAssignmentExpression(node);
|
710
710
|
if (!evaluationNode) {
|
711
|
-
this.
|
711
|
+
this._addSyntaxError(localize_1.LocMessage.assignmentExprContext(), node);
|
712
712
|
this.walk(node.name);
|
713
713
|
}
|
714
714
|
else {
|
@@ -724,7 +724,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
724
724
|
while (curScope && curScope !== containerScope) {
|
725
725
|
const localSymbol = curScope.lookUpSymbol(node.name.value);
|
726
726
|
if (localSymbol) {
|
727
|
-
this.
|
727
|
+
this._addSyntaxError(localize_1.LocMessage.assignmentExprComprehension().format({ name: node.name.value }), node.name);
|
728
728
|
break;
|
729
729
|
}
|
730
730
|
curScope = curScope.parent;
|
@@ -776,7 +776,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
776
776
|
}
|
777
777
|
if (emitDunderAllWarning) {
|
778
778
|
this._usesUnsupportedDunderAllForm = true;
|
779
|
-
this._addDiagnostic(this._fileInfo.diagnosticRuleSet.reportUnsupportedDunderAll, diagnosticRules_1.DiagnosticRule.reportUnsupportedDunderAll, localize_1.
|
779
|
+
this._addDiagnostic(this._fileInfo.diagnosticRuleSet.reportUnsupportedDunderAll, diagnosticRules_1.DiagnosticRule.reportUnsupportedDunderAll, localize_1.LocMessage.unsupportedDunderAllOperation(), node);
|
780
780
|
}
|
781
781
|
}
|
782
782
|
return false;
|
@@ -854,7 +854,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
854
854
|
if (node.asyncToken && !this._fileInfo.ipythonMode) {
|
855
855
|
const enclosingFunction = ParseTreeUtils.getEnclosingFunction(node);
|
856
856
|
if (!enclosingFunction || !enclosingFunction.isAsync) {
|
857
|
-
this.
|
857
|
+
this._addSyntaxError(localize_1.LocMessage.asyncNotInAsyncFunction(), node.asyncToken);
|
858
858
|
}
|
859
859
|
}
|
860
860
|
return false;
|
@@ -897,14 +897,14 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
897
897
|
}
|
898
898
|
visitYield(node) {
|
899
899
|
if (this._isInListComprehension(node, /* ignoreOutermostIterable */ true)) {
|
900
|
-
this.
|
900
|
+
this._addSyntaxError(localize_1.LocMessage.yieldWithinListCompr(), node);
|
901
901
|
}
|
902
902
|
this._bindYield(node);
|
903
903
|
return false;
|
904
904
|
}
|
905
905
|
visitYieldFrom(node) {
|
906
906
|
if (this._isInListComprehension(node, /* ignoreOutermostIterable */ true)) {
|
907
|
-
this.
|
907
|
+
this._addSyntaxError(localize_1.LocMessage.yieldWithinListCompr(), node);
|
908
908
|
}
|
909
909
|
this._bindYield(node);
|
910
910
|
return false;
|
@@ -1201,7 +1201,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1201
1201
|
// generator expressions is deferred and therefore can be
|
1202
1202
|
// run within the context of an async function later.
|
1203
1203
|
if (((_a = node.parent) === null || _a === void 0 ? void 0 : _a.nodeType) !== 32 /* ParseNodeType.ListComprehension */) {
|
1204
|
-
this.
|
1204
|
+
this._addSyntaxError(localize_1.LocMessage.awaitNotInAsync(), node);
|
1205
1205
|
}
|
1206
1206
|
}
|
1207
1207
|
return true;
|
@@ -1212,12 +1212,12 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1212
1212
|
const nameValue = name.value;
|
1213
1213
|
// Is the binding inconsistent?
|
1214
1214
|
if (this._currentScope.getBindingType(nameValue) === 0 /* NameBindingType.Nonlocal */) {
|
1215
|
-
this.
|
1215
|
+
this._addSyntaxError(localize_1.LocMessage.nonLocalRedefinition().format({ name: nameValue }), name);
|
1216
1216
|
}
|
1217
1217
|
const valueWithScope = this._currentScope.lookUpSymbolRecursive(nameValue);
|
1218
1218
|
// Was the name already assigned within this scope before it was declared global?
|
1219
1219
|
if (valueWithScope && valueWithScope.scope === this._currentScope) {
|
1220
|
-
this.
|
1220
|
+
this._addSyntaxError(localize_1.LocMessage.globalReassignment().format({ name: nameValue }), name);
|
1221
1221
|
}
|
1222
1222
|
// Add it to the global scope if it's not already added.
|
1223
1223
|
this._bindNameToScope(globalScope, name);
|
@@ -1230,22 +1230,22 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1230
1230
|
visitNonlocal(node) {
|
1231
1231
|
const globalScope = this._currentScope.getGlobalScope().scope;
|
1232
1232
|
if (this._currentScope === globalScope) {
|
1233
|
-
this.
|
1233
|
+
this._addSyntaxError(localize_1.LocMessage.nonLocalInModule(), node);
|
1234
1234
|
}
|
1235
1235
|
else {
|
1236
1236
|
node.nameList.forEach((name) => {
|
1237
1237
|
const nameValue = name.value;
|
1238
1238
|
// Is the binding inconsistent?
|
1239
1239
|
if (this._currentScope.getBindingType(nameValue) === 1 /* NameBindingType.Global */) {
|
1240
|
-
this.
|
1240
|
+
this._addSyntaxError(localize_1.LocMessage.globalRedefinition().format({ name: nameValue }), name);
|
1241
1241
|
}
|
1242
1242
|
const valueWithScope = this._currentScope.lookUpSymbolRecursive(nameValue);
|
1243
1243
|
// Was the name already assigned within this scope before it was declared nonlocal?
|
1244
1244
|
if (valueWithScope && valueWithScope.scope === this._currentScope) {
|
1245
|
-
this.
|
1245
|
+
this._addSyntaxError(localize_1.LocMessage.nonLocalReassignment().format({ name: nameValue }), name);
|
1246
1246
|
}
|
1247
1247
|
else if (!valueWithScope || valueWithScope.scope === globalScope) {
|
1248
|
-
this.
|
1248
|
+
this._addSyntaxError(localize_1.LocMessage.nonLocalNoBinding().format({ name: nameValue }), name);
|
1249
1249
|
}
|
1250
1250
|
if (valueWithScope) {
|
1251
1251
|
this._currentScope.setBindingType(nameValue, 0 /* NameBindingType.Nonlocal */);
|
@@ -1336,7 +1336,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1336
1336
|
}
|
1337
1337
|
if (node.isWildcardImport) {
|
1338
1338
|
if (ParseTreeUtils.getEnclosingClass(node) || ParseTreeUtils.getEnclosingFunction(node)) {
|
1339
|
-
this.
|
1339
|
+
this._addSyntaxError(localize_1.LocMessage.wildcardInFunction(), node);
|
1340
1340
|
}
|
1341
1341
|
if (importInfo) {
|
1342
1342
|
const names = [];
|
@@ -1573,7 +1573,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1573
1573
|
// Top level async with is allowed in ipython mode.
|
1574
1574
|
const enclosingFunction = ParseTreeUtils.getEnclosingFunction(node);
|
1575
1575
|
if (!enclosingFunction || !enclosingFunction.isAsync) {
|
1576
|
-
this.
|
1576
|
+
this._addSyntaxError(localize_1.LocMessage.asyncNotInAsyncFunction(), node.asyncToken);
|
1577
1577
|
}
|
1578
1578
|
}
|
1579
1579
|
});
|
@@ -1675,7 +1675,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1675
1675
|
// generator expressions is deferred and therefore can be
|
1676
1676
|
// run within the context of an async function later.
|
1677
1677
|
if (((_a = node.parent) === null || _a === void 0 ? void 0 : _a.nodeType) === 31 /* ParseNodeType.List */) {
|
1678
|
-
this.
|
1678
|
+
this._addSyntaxError(localize_1.LocMessage.asyncNotInAsyncFunction(), compr.asyncToken);
|
1679
1679
|
}
|
1680
1680
|
}
|
1681
1681
|
}
|
@@ -2963,7 +2963,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
2963
2963
|
}
|
2964
2964
|
}
|
2965
2965
|
if (!declarationHandled) {
|
2966
|
-
this._addDiagnostic(this._fileInfo.diagnosticRuleSet.
|
2966
|
+
this._addDiagnostic(this._fileInfo.diagnosticRuleSet.reportInvalidTypeForm, diagnosticRules_1.DiagnosticRule.reportInvalidTypeForm, localize_1.LocMessage.annotationNotSupported(), typeAnnotation);
|
2967
2967
|
}
|
2968
2968
|
}
|
2969
2969
|
// Determines whether the expression refers to a type exported by the typing
|
@@ -3252,13 +3252,13 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
3252
3252
|
const functionNode = ParseTreeUtils.getEnclosingFunction(node);
|
3253
3253
|
if (!functionNode) {
|
3254
3254
|
if (!ParseTreeUtils.getEnclosingLambda(node)) {
|
3255
|
-
this.
|
3255
|
+
this._addSyntaxError(localize_1.LocMessage.yieldOutsideFunction(), node);
|
3256
3256
|
}
|
3257
3257
|
}
|
3258
3258
|
else if (functionNode.isAsync && node.nodeType === 61 /* ParseNodeType.YieldFrom */) {
|
3259
3259
|
// PEP 525 indicates that 'yield from' is not allowed in an
|
3260
3260
|
// async function.
|
3261
|
-
this.
|
3261
|
+
this._addSyntaxError(localize_1.LocMessage.yieldFromOutsideAsync(), node);
|
3262
3262
|
}
|
3263
3263
|
if (this._targetFunctionDeclaration) {
|
3264
3264
|
if (!this._targetFunctionDeclaration.yieldStatements) {
|
@@ -3280,13 +3280,9 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
3280
3280
|
let diagnostic;
|
3281
3281
|
switch (diagLevel) {
|
3282
3282
|
case 'error':
|
3283
|
-
diagnostic = this._addError(message, textRange);
|
3284
|
-
break;
|
3285
3283
|
case 'warning':
|
3286
|
-
diagnostic = this._addWarning(message, textRange);
|
3287
|
-
break;
|
3288
3284
|
case 'information':
|
3289
|
-
diagnostic = this.
|
3285
|
+
diagnostic = this._fileInfo.diagnosticSink.addDiagnosticWithTextRange(diagLevel, message, textRange);
|
3290
3286
|
break;
|
3291
3287
|
case 'none':
|
3292
3288
|
break;
|
@@ -3298,15 +3294,9 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
3298
3294
|
}
|
3299
3295
|
return diagnostic;
|
3300
3296
|
}
|
3301
|
-
|
3297
|
+
_addSyntaxError(message, textRange) {
|
3302
3298
|
return this._fileInfo.diagnosticSink.addDiagnosticWithTextRange('error', message, textRange);
|
3303
3299
|
}
|
3304
|
-
_addWarning(message, textRange) {
|
3305
|
-
return this._fileInfo.diagnosticSink.addDiagnosticWithTextRange('warning', message, textRange);
|
3306
|
-
}
|
3307
|
-
_addInformation(message, textRange) {
|
3308
|
-
return this._fileInfo.diagnosticSink.addDiagnosticWithTextRange('information', message, textRange);
|
3309
|
-
}
|
3310
3300
|
}
|
3311
3301
|
exports.Binder = Binder;
|
3312
3302
|
// Flow node that is used for unreachable code.
|