[ty] Improve UX for [duplicate-base] diagnostics#17914
Conversation
|
|
Nice. I think this does have the downside that it's now only possible to suppress the error at the first or last line of the class declaration but not where the base class is repeated (because suppressions use the primary range). Have you considered changing the primary range to the arguments range instead of the entire class header? |
70d6aad to
8351343
Compare
Yeah. I think this is justifiable, though, given that it's the class definition as a whole that will fail and raise an exception at runtime, not any of the sub-expressions inside the argument list.
I could do that, but again, it's the class definition as a whole that will fail; the name of the class feels like relevant information that's useful to have highlighted |
84d8df2 to
291f4d0
Compare
291f4d0 to
1ec9b0e
Compare
51bbfcd to
e99571b
Compare
…lass * origin/main: [`pylint`] add fix safety section (`PLC2801`) (#17825) Add instructions on how to upgrade to a newer Rust version (#17928) [parser] Flag single unparenthesized generator expr with trailing comma in arguments. (#17893) [ty] Ensure that `T` is disjoint from `~T` even when `T` is a TypeVar (#17922) [ty] Sort collected diagnostics before snapshotting them in mdtest (#17926) [ty] Add basic file watching to server (#17912) Make completions an opt-in LSP feature (#17921) Add link to `ty` issue tracker (#17924) [ty] Add support for `__all__` (#17856) [ty] fix assigning a typevar to a union with itself (#17910) [ty] Improve UX for `[duplicate-base]` diagnostics (#17914) Clean up some Ruff references in the ty server (#17920)
Summary
This PR improves the UX of our
duplicate-basediagnostics so that we:TypeErrorat runtime)Screenshot of what the new diagnostics look like in the terminal
Test Plan
Snapshots added