ruff/crates/ty_python_semantic/resources/mdtest/subscript
Alex Waygood d63b4b0383
[ty] Improve diagnostic range for non-subscriptable diagnostics (#21461)
## Summary

Currently our diagnostic only covers the range of the thing being
subscripted:

<img width="1702" height="312" alt="image"
src="https://github.com/user-attachments/assets/7e630431-e846-46ca-93c1-139f11aaba11"
/>

But it should probably cover the _whole_ subscript expression (arguably
the more "incorrect" bit is the `["foo"]` part of this expression, not
the `x` part of this expression!)

## Test Plan

Added a snapshot

Co-authored-by: Brent Westbrook
<36778786+ntBre@users.noreply.github.com>
2025-11-14 21:15:14 +00:00
..
assignment_diagnostics.md [ty] Faster subscript assignment checks for (unions of) TypedDicts (#21378) 2025-11-12 20:16:38 +01:00
bytes.md [ty] Integer indexing into bytes returns int (#18218) 2025-05-20 16:44:12 +02:00
class.md [ty] __class_getitem__ is a classmethod (#20192) 2025-09-01 11:22:19 +02:00
instance.md [ty] Improve diagnostic range for non-subscriptable diagnostics (#21461) 2025-11-14 21:15:14 +00:00
lists.md [ty] Infer more precise types for collection literals (#20360) 2025-09-17 18:51:50 -04:00
stepsize_zero.md
string.md
tuple.md [ty] Fix bug where ty would think all types had an __mro__ attribute (#20995) 2025-10-27 11:19:12 +00:00