ruff/crates
Douglas Creager 585ce12ace
[ty] typing.Self is bound by the method, not the class (#19784)
This fixes our logic for binding a legacy typevar with its binding
context. (To recap, a legacy typevar starts out "unbound" when it is
first created, and each time it's used in a generic class or function,
we "bind" it with the corresponding `Definition`.)

We treat `typing.Self` the same as a legacy typevar, and so we apply
this binding logic to it too. Before, we were using the enclosing class
as its binding context. But that's not correct — it's the method where
`typing.Self` is used that binds the typevar. (Each invocation of the
method will find a new specialization of `Self` based on the specific
instance type containing the invoked method.)

This required plumbing through some additional state to the
`in_type_expression` method.

This also revealed that we weren't handling `Self`-typed instance
attributes correctly (but were coincidentally not getting the expected
false positive diagnostics).
2025-08-06 17:26:17 -04:00
..
ruff [flake8_import_conventions] Avoid false positives for NFKC-normalized __debug__ import aliases in ICN001 (#19411) 2025-08-06 06:42:51 +00:00
ruff_annotate_snippets [ty] Remap Jupyter notebook cell indices in ruff_db (#19698) 2025-08-05 14:10:35 -04:00
ruff_benchmark [ty] Remove special casing for tuple addition (#19636) 2025-07-30 16:25:42 +00:00
ruff_cache Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_db [ty] Avoid overcounting shared memory usage (#19773) 2025-08-06 15:32:02 -04:00
ruff_dev Auto-generate environment variable references for ty (#19205) 2025-07-08 10:48:31 -04:00
ruff_diagnostics [ty] Implement diagnostic caching (#19605) 2025-07-30 11:04:34 +01:00
ruff_formatter Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_graph [ty] Remove KnownModule::is_enum (#19681) 2025-08-01 10:31:12 +02:00
ruff_index Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011) 2025-06-28 20:24:00 +02:00
ruff_linter [pylint] Mark PLC0207 fixes as unsafe when *args unpacking is present (#19679) 2025-08-06 14:19:49 -04:00
ruff_macros [ty] Support LSP client settings (#19614) 2025-08-06 18:37:21 +05:30
ruff_memory_usage [ty] Avoid overcounting shared memory usage (#19773) 2025-08-06 15:32:02 -04:00
ruff_notebook Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_options_metadata [ty] Document configuration schema (#17950) 2025-05-09 10:47:45 +02:00
ruff_python_ast Disallow implicit concatenation of t-strings and other string types (#19485) 2025-07-27 12:41:03 +00:00
ruff_python_ast_integration_tests Disallow implicit concatenation of t-strings and other string types (#19485) 2025-07-27 12:41:03 +00:00
ruff_python_codegen Disallow implicit concatenation of t-strings and other string types (#19485) 2025-07-27 12:41:03 +00:00
ruff_python_formatter Disallow implicit concatenation of t-strings and other string types (#19485) 2025-07-27 12:41:03 +00:00
ruff_python_index Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_literal Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_parser Disallow implicit concatenation of t-strings and other string types (#19485) 2025-07-27 12:41:03 +00:00
ruff_python_semantic [ty] Make Module a Salsa ingredient 2025-07-23 09:46:40 -04:00
ruff_python_stdlib Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_trivia Treat ty: comments as pragma comments (#18532) 2025-06-07 16:02:43 +02:00
ruff_python_trivia_integration_tests Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_server [ty] Implement long-polling for workspace diagnsotics (#19670) 2025-08-04 10:26:38 +00:00
ruff_source_file [ty] Implement diagnostic caching (#19605) 2025-07-30 11:04:34 +01:00
ruff_text_size [ty] Add environment variable to dump Salsa memory usage stats (#18928) 2025-06-26 21:27:51 +00:00
ruff_wasm Allow hiding the diagnostic severity in ruff_db (#19644) 2025-08-05 09:56:18 -04:00
ruff_workspace [flake8_import_conventions] Avoid false positives for NFKC-normalized __debug__ import aliases in ICN001 (#19411) 2025-08-06 06:42:51 +00:00
ty [ty] Support LSP client settings (#19614) 2025-08-06 18:37:21 +05:30
ty_combine [ty] Support LSP client settings (#19614) 2025-08-06 18:37:21 +05:30
ty_ide [ty] typing.Self is bound by the method, not the class (#19784) 2025-08-06 17:26:17 -04:00
ty_project [ty] Avoid overcounting shared memory usage (#19773) 2025-08-06 15:32:02 -04:00
ty_python_semantic [ty] typing.Self is bound by the method, not the class (#19784) 2025-08-06 17:26:17 -04:00
ty_server [ty] Avoid warning for old settings schema too aggresively (#19787) 2025-08-06 16:16:59 +00:00
ty_static [ty] Merge ty_macros into ruff_macros (#19229) 2025-07-09 11:28:21 +00:00
ty_test [ty] Track open files in the server (#19264) 2025-07-18 19:33:35 +05:30
ty_vendored [ty] Improve debuggability of protocol types (#19662) 2025-08-01 15:16:13 +01:00
ty_wasm [ty] Support stdlib files in playground (#19557) 2025-07-26 19:33:38 +01:00