ruff/crates/ty/docs
David Peter 5ca9c15fc8
[ty] Better invalid-assignment diagnostics (#21476)
## Summary

Improve the diagnostic range for `invalid-assignment` diagnostics, and
add source annotations for the value and target type.

closes https://github.com/astral-sh/ty/issues/1556

### Before

<img width="836" height="601" alt="image"
src="https://github.com/user-attachments/assets/a48219bb-58a8-4a83-b290-d09ef50ce5f0"
/>

### After

<img width="857" height="742" alt="image"
src="https://github.com/user-attachments/assets/cfcaa4f4-94fb-459e-8d64-97050dfecb50"
/>

## Ecosystem impact

Very good! Due to the wider diagnostic range, we now pick up more `#
type: ignore` directives that were supposed to suppress an invalid
assignment diagnostic.

## Test Plan

New snapshot tests
2025-11-18 14:31:04 +01:00
..
.gitattributes [ty] Mark generated files as such in .gitattributes (#18195) 2025-05-19 16:50:48 +02:00
cli.md [ty] Add `--no-progress` option (#21063) 2025-10-24 18:00:00 +02:00
configuration.md [ty] Use 3.14 as the default version (#20759) 2025-10-08 11:38:47 +02:00
environment.md [ty] Add `--venv` as an alias to `--python` (#20718) 2025-10-06 13:03:05 +01:00
mypy_primer.md [ty] Update mypy_primer doc (#18638) 2025-06-11 20:50:37 -07:00
rules.md [ty] Better invalid-assignment diagnostics (#21476) 2025-11-18 14:31:04 +01:00
tracing-flamegraph.png Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
tracing.md [ty] Minor typo in environment variable name (#17848) 2025-05-05 10:25:48 +00:00