You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like it better if only the argument was highlighted. I wanted to make this change quickly, but it's not completely straightforward and messes with CallOutcome (which @AlexWaygood is working on), so I figured I'd create a ticket instead.
This is also somewhat related to multiple-range diagnostics, because for functions like assert_type(<expr>, <type-expr>), we might want to highlight the first argument ("… has type <actual-type>") and then create a separate (informational?) text range for <type-expr> to highlight it as the expected type. In any case, we can certainly do better than this:
error: lint:type-assertion-failure
--> /home/shark/playground/test.py:4:1
|
2 | from typing import assert_type
3 |
4 | assert_type(2 + 3, str)
| ^^^^^^^^^^^^^^^^^^^^^^^ Actual type `Literal[5]` is not the same as asserted type `str`
|
The text was updated successfully, but these errors were encountered:
Description
We currently highlight the full call expression for
reveal_type
-diagnostics andstatic_assert
diagnostics:I would like it better if only the argument was highlighted. I wanted to make this change quickly, but it's not completely straightforward and messes with
CallOutcome
(which @AlexWaygood is working on), so I figured I'd create a ticket instead.This is also somewhat related to multiple-range diagnostics, because for functions like
assert_type(<expr>, <type-expr>)
, we might want to highlight the first argument ("… has type <actual-type>"
) and then create a separate (informational?) text range for<type-expr>
to highlight it as the expected type. In any case, we can certainly do better than this:The text was updated successfully, but these errors were encountered: