Description
Split reportCallIssue into more granular diagnostics
Currently, many unrelated call-validation problems are reported through the generic reportCallIssue diagnostic. As a result, users who want to suppress generic overload-related diagnostics are forced to disable validation for many other useful call errors as well.
Examples:
a = "hello"
a.replace("")
Current diagnostic:
No overloads for "replace" match the provided arguments
Actual issue:
Missing required argument "new"
a = "hello"
a.replace("x", new="")
Current diagnostic:
No overloads for "replace" match the provided arguments
Actual issue:
Parameter "new" is positional-only
or:
Keyword argument "new" is not allowed
def func(a: str, b: str) -> None:
pass
func("x")
Actual issue:
Missing required argument "b"
I would like argument-related diagnostics to be separated from overload-resolution diagnostics.
Ideally, the following categories could be configured independently:
- Missing required arguments
- Unknown keyword arguments
- Positional-only parameter violations
- Too many arguments
- Overload mismatches
For example:
{
"reportMissingArgument": "error",
"reportUnknownKeywordArgument": "error",
"reportPositionalOnlyViolation": "error",
"reportTooManyArguments": "error",
"reportOverloadMismatch": "warning"
}
My use case is that I would like to suppress generic overload-mismatch diagnostics while still keeping validation for missing arguments, unknown arguments, positional-only violations, and similar mistakes.
Even if separate configuration options are not added, it would still be a significant usability improvement if obvious cases were reported using their actual root cause rather than being surfaced as a generic overload-resolution failure.
Description
Split
reportCallIssueinto more granular diagnosticsCurrently, many unrelated call-validation problems are reported through the generic
reportCallIssuediagnostic. As a result, users who want to suppress generic overload-related diagnostics are forced to disable validation for many other useful call errors as well.Examples:
Current diagnostic:
Actual issue:
Current diagnostic:
Actual issue:
or:
Actual issue:
I would like argument-related diagnostics to be separated from overload-resolution diagnostics.
Ideally, the following categories could be configured independently:
For example:
{ "reportMissingArgument": "error", "reportUnknownKeywordArgument": "error", "reportPositionalOnlyViolation": "error", "reportTooManyArguments": "error", "reportOverloadMismatch": "warning" }My use case is that I would like to suppress generic overload-mismatch diagnostics while still keeping validation for missing arguments, unknown arguments, positional-only violations, and similar mistakes.
Even if separate configuration options are not added, it would still be a significant usability improvement if obvious cases were reported using their actual root cause rather than being surfaced as a generic overload-resolution failure.