Commit 06f9f52
authored
[ty] Add support for
* [x] basic handling
* [x] parse and discover `@warnings.deprecated` attributes
* [x] associate them with function definitions
* [x] associate them with class definitions
* [x] add a new "deprecated" diagnostic
* [x] ensure diagnostic is styled appropriately for LSPs
(DiagnosticTag::Deprecated)
* [x] functions
* [x] fire on calls
* [x] fire on arbitrary references
* [x] classes
* [x] fire on initializers
* [x] fire on arbitrary references
* [x] methods
* [x] fire on calls
* [x] fire on arbitrary references
* [ ] overloads
* [ ] fire on calls
* [ ] fire on arbitrary references(??? maybe not ???)
* [ ] only fire if the actual selected overload is deprecated
* [ ] dunder desugarring (warn on deprecated `__add__` if `+` is
invoked)
* [ ] alias supression? (don't warn on uses of variables that deprecated
items were assigned to)
* [ ] import logic
* [x] fire on imports of deprecated items
* [ ] suppress subsequent diagnostics if the import diagnostic fired (is
this handled by alias supression?)
* [x] fire on all qualified references (`module.mydeprecated`)
* [x] fire on all references that depend on a `*` import
Fixes astral-sh/ty#153@warnings.deprecated (astral-sh#19376)1 parent e9a64e5 commit 06f9f52
File tree
15 files changed
+1000
-73
lines changed- crates
- ruff_benchmark/benches
- ty_python_semantic
- resources/mdtest
- snapshots
- src
- module_resolver
- types
- call
- ty/docs
15 files changed
+1000
-73
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
530 | | - | |
| 530 | + | |
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
538 | 545 | | |
539 | 546 | | |
540 | 547 | | |
| |||
544 | 551 | | |
545 | 552 | | |
546 | 553 | | |
547 | | - | |
| 554 | + | |
548 | 555 | | |
549 | 556 | | |
550 | 557 | | |
| |||
612 | 619 | | |
613 | 620 | | |
614 | 621 | | |
615 | | - | |
| 622 | + | |
616 | 623 | | |
617 | 624 | | |
618 | 625 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments