mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 07:55:56 +03:00
added module name to moduleUnknownMember diagnostic to help inform wh… (#4691)
This commit is contained in:
parent
712d560ca6
commit
9b0127cde3
@ -5194,7 +5194,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
|
||||
addDiagnostic(
|
||||
fileInfo.diagnosticRuleSet.reportGeneralTypeIssues,
|
||||
DiagnosticRule.reportGeneralTypeIssues,
|
||||
Localizer.Diagnostic.moduleUnknownMember().format({ name: memberName }),
|
||||
Localizer.Diagnostic.moduleUnknownMember().format({
|
||||
memberName,
|
||||
moduleName: baseType.moduleName,
|
||||
}),
|
||||
node.memberName
|
||||
);
|
||||
}
|
||||
|
@ -549,7 +549,9 @@ export namespace Localizer {
|
||||
export const moduleAsType = () => getRawString('Diagnostic.moduleAsType');
|
||||
export const moduleNotCallable = () => getRawString('Diagnostic.moduleNotCallable');
|
||||
export const moduleUnknownMember = () =>
|
||||
new ParameterizedString<{ name: string }>(getRawString('Diagnostic.moduleUnknownMember'));
|
||||
new ParameterizedString<{ memberName: string; moduleName: string }>(
|
||||
getRawString('Diagnostic.moduleUnknownMember')
|
||||
);
|
||||
export const namedExceptAfterCatchAll = () => getRawString('Diagnostic.namedExceptAfterCatchAll');
|
||||
export const namedParamAfterParamSpecArgs = () =>
|
||||
new ParameterizedString<{ name: string }>(getRawString('Diagnostic.namedParamAfterParamSpecArgs'));
|
||||
|
@ -252,7 +252,7 @@
|
||||
"missingSuperCall": "Method \"{methodName}\" does not call the method of the same name in parent class",
|
||||
"moduleAsType": "Module cannot be used as a type",
|
||||
"moduleNotCallable": "Module is not callable",
|
||||
"moduleUnknownMember": "\"{name}\" is not a known member of module",
|
||||
"moduleUnknownMember": "\"{memberName}\" is not a known member of module \"{moduleName}\"",
|
||||
"namedExceptAfterCatchAll": "A named except clause cannot appear after catch-all except clause",
|
||||
"namedParamAfterParamSpecArgs": "Keyword parameter \"{name}\" cannot appear in signature after ParamSpec args parameter",
|
||||
"namedTupleEmptyName": "Names within a named tuple cannot be empty",
|
||||
|
Loading…
Reference in New Issue
Block a user