From f896d9ab4b359c1e304e2670b3b5ac0d09c3db10 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 25 Nov 2025 12:01:01 -0800 Subject: [PATCH 01/15] Bump version to 0.0.1-alpha.28 --- CHANGELOG.md | 86 ++++++++++++- dist-workspace.toml | 2 +- docs/reference/rules.md | 270 +++++++++++++++++++++++++++++----------- pyproject.toml | 2 +- ruff | 2 +- uv.lock | 2 +- 6 files changed, 283 insertions(+), 81 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 698e1f946f..1bdd223fca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,79 @@ # Changelog +## 0.0.1-alpha.28 + +Released on 2025-11-25. + +### Bug fixes + +- Fix panic for unclosed string literal in type annotation position ([#21592](https://github.com/astral-sh/ruff/pull/21592)) +- Fix subtraction overflow bug ([#21570](https://github.com/astral-sh/ruff/pull/21570)) + +### LSP server + +- Add 'remove unused ignore comment' code action ([#21582](https://github.com/astral-sh/ruff/pull/21582)) +- Add goto for `Unknown` when it appears in an inlay hint ([#21545](https://github.com/astral-sh/ruff/pull/21545)) +- Add more random TypeDetails and tests ([#21546](https://github.com/astral-sh/ruff/pull/21546)) +- Add type definitions for `Type::SpecialForm`s ([#21544](https://github.com/astral-sh/ruff/pull/21544)) +- Don't suggest things that aren't subclasses of `BaseException` after `raise` ([#21571](https://github.com/astral-sh/ruff/pull/21571)) +- Double click to insert inlay hint ([#21600](https://github.com/astral-sh/ruff/pull/21600)) +- Fix edge cases for autocomplete suppressions in variable bindings ([#21576](https://github.com/astral-sh/ruff/pull/21576)) +- Implement docstring rendering to markdown ([#21550](https://github.com/astral-sh/ruff/pull/21550)) +- Implement goto-definition and find-references for global/nonlocal statements ([#21616](https://github.com/astral-sh/ruff/pull/21616)) +- Implement goto-type for inlay type hints ([#21533](https://github.com/astral-sh/ruff/pull/21533)) +- Implement lsp support for string annotations ([#21577](https://github.com/astral-sh/ruff/pull/21577)) +- Improve import detection for completions and support `from ...` completions ([#21547](https://github.com/astral-sh/ruff/pull/21547)) +- Improve lsp handling of hover/goto on imports ([#21572](https://github.com/astral-sh/ruff/pull/21572)) +- Inlay Hint edit follow up ([#21621](https://github.com/astral-sh/ruff/pull/21621)) +- More low-hanging fruit for inlay hint goto-definition ([#21548](https://github.com/astral-sh/ruff/pull/21548)) +- Resolve overloads for hovers ([#21417](https://github.com/astral-sh/ruff/pull/21417)) +- Semantic tokens: consistently add the `DEFINITION` modifier ([#21521](https://github.com/astral-sh/ruff/pull/21521)) +- suppress autocomplete suggestions during variable binding ([#21549](https://github.com/astral-sh/ruff/pull/21549)) + +### CLI + +- Exit with `2` if there's any IO error ([#21508](https://github.com/astral-sh/ruff/pull/21508)) + +### Other changes + +- Add hint about resolved Python version when a user attempts to import a member added on a newer version ([#21615](https://github.com/astral-sh/ruff/pull/21615)) +- Attach subdiagnostics to `unresolved-import` errors for relative imports as well as absolute imports ([#21554](https://github.com/astral-sh/ruff/pull/21554)) +- Avoid expression reinference for diagnostics ([#21267](https://github.com/astral-sh/ruff/pull/21267)) +- Check method definitions on subclasses for Liskov violations ([#21436](https://github.com/astral-sh/ruff/pull/21436)) +- Eagerly evaluate `types.UnionType` elements as type expressions ([#21531](https://github.com/astral-sh/ruff/pull/21531)) +- Extend Liskov checks to also cover classmethods and staticmethods ([#21598](https://github.com/astral-sh/ruff/pull/21598)) +- Fix rendering of unused suppression diagnostic ([#21580](https://github.com/astral-sh/ruff/pull/21580)) +- Implement `typing.override` ([#21627](https://github.com/astral-sh/ruff/pull/21627)) +- Improve concise diagnostics for invalid exceptions when a user catches a tuple of objects ([#21578](https://github.com/astral-sh/ruff/pull/21578)) +- Improve debug messages when imports fail ([#21555](https://github.com/astral-sh/ruff/pull/21555)) +- Improve diagnostics when `NotImplemented` is called ([#21523](https://github.com/astral-sh/ruff/pull/21523)) +- Improve diagnostics when a submodule is not available as an attribute on a module-literal type ([#21561](https://github.com/astral-sh/ruff/pull/21561)) +- Improve several "Did you mean?" suggestions ([#21597](https://github.com/astral-sh/ruff/pull/21597)) +- Narrow type context during literal promotion in generic class constructors ([#21574](https://github.com/astral-sh/ruff/pull/21574)) +- Retain the function-like-ness of `Callable` types when binding `self` ([#21614](https://github.com/astral-sh/ruff/pull/21614)) +- Substitute for `typing.Self` when checking protocol members ([#21569](https://github.com/astral-sh/ruff/pull/21569)) +- Switch the error code from `unresolved-attribute` to `possibly-missing-attribute` for submodules that may not be available ([#21618](https://github.com/astral-sh/ruff/pull/21618)) +- implement `TypedDict` structural assignment ([#21467](https://github.com/astral-sh/ruff/pull/21467)) +- make implicit submodule imports re-exported ([#21573](https://github.com/astral-sh/ruff/pull/21573)) +- support PEP 613 type aliases ([#21394](https://github.com/astral-sh/ruff/pull/21394)) +- support generic aliases in `type[...]`, like `type[C[int]]` ([#21552](https://github.com/astral-sh/ruff/pull/21552)) +- tighten up handling of subscripts in type expressions ([#21503](https://github.com/astral-sh/ruff/pull/21503)) + +### Contributors + +- [@Gankra](https://github.com/Gankra) +- [@MatthewMckee4](https://github.com/MatthewMckee4) +- [@AlexWaygood](https://github.com/AlexWaygood) +- [@RasmusNygren](https://github.com/RasmusNygren) +- [@dcreager](https://github.com/dcreager) +- [@BurntSushi](https://github.com/BurntSushi) +- [@carljm](https://github.com/carljm) +- [@MichaReiser](https://github.com/MichaReiser) +- [@sharkdp](https://github.com/sharkdp) +- [@oconnor663](https://github.com/oconnor663) +- [@lucach](https://github.com/lucach) +- [@ibraheemdev](https://github.com/ibraheemdev) + ## 0.0.1-alpha.27 Released on 2025-11-18. @@ -920,18 +994,18 @@ Released on 2025-10-10. - Add cycle detection to ty's implementation of disjointness between types, fixing a possible source of stack overflows when analysing recursive types ([#19139](https://github.com/astral-sh/ruff/pull/19139)) - Don't allow first-party code to shadow the stdlib `types` module ([#19128](https://github.com/astral-sh/ruff/pull/19128)). - This fixes another possible source of stack overflows. +This fixes another possible source of stack overflows. - Fix descriptor lookups for most types that overlap with `None` ([#19120](https://github.com/astral-sh/ruff/pull/19120)). - This means that e.g. `object().__str__()` now correctly binds the `self` argument of the `__str__` - method, as the `object` type overlaps with `None`. +This means that e.g. `object().__str__()` now correctly binds the `self` argument of the `__str__` +method, as the `object` type overlaps with `None`. ### Server - Filter a symbol from a stub file in autocomplete suggestions if it is an implementation detail of the stub ([#19121](https://github.com/astral-sh/ruff/pull/19121)) - Add initial support for [semantic tokens](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens) ([#19108](https://github.com/astral-sh/ruff/pull/19108)). - This feature allows editors to apply more advanced syntax highlighting. Currently, the supported tokens are: `Namespace`, `Class`, `Parameter`, `SelfParameter`,`ClsParameter`, `Variable`, `Property`, `Function`, `Method`, `Keyword`, `String`, `Number`, `Decorator`, `BuiltinConstant` and `TypeParameter`. +This feature allows editors to apply more advanced syntax highlighting. Currently, the supported tokens are: `Namespace`, `Class`, `Parameter`, `SelfParameter`,`ClsParameter`, `Variable`, `Property`, `Function`, `Method`, `Keyword`, `String`, `Number`, `Decorator`, `BuiltinConstant` and `TypeParameter`. - Initial support for [workspace diagnostics](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_diagnostic) ([#18939](https://github.com/astral-sh/ruff/pull/18939)). - Enable this feature by setting the `ty.diagnosticMode` configuration setting to `"workspace"`. +Enable this feature by setting the `ty.diagnosticMode` configuration setting to `"workspace"`. - Use Python syntax highlighting in on-hover content ([#19082](https://github.com/astral-sh/ruff/pull/19082)) ### Typing semantics and features @@ -1121,7 +1195,7 @@ Released on 2025-10-10. ### Bug fixes - Delay computation of 'unbound' visibility for implicit instance attributes ([#18669](https://github.com/astral-sh/ruff/pull/18669)). - This fixes a significant performance regression in version 0.0.1-alpha.9. +This fixes a significant performance regression in version 0.0.1-alpha.9. ### Typing semantics and features diff --git a/dist-workspace.toml b/dist-workspace.toml index 0f5d9cbfbd..1600666d94 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -1,7 +1,7 @@ [workspace] members = ["cargo:./ruff"] packages = ["ty"] -version = "0.0.1-alpha.27" +version = "0.0.1-alpha.28" # Config for 'dist' [dist] diff --git a/docs/reference/rules.md b/docs/reference/rules.md index 7131564c47..a6b571c402 100644 --- a/docs/reference/rules.md +++ b/docs/reference/rules.md @@ -39,7 +39,7 @@ def test(): -> "int": Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -63,7 +63,7 @@ Calling a non-callable object will raise a `TypeError` at runtime. Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -95,7 +95,7 @@ f(int) # error Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -126,7 +126,7 @@ a = 1 Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -158,7 +158,7 @@ class C(A, B): ... Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -190,7 +190,7 @@ class B(A): ... Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -217,7 +217,7 @@ class B(A, A): ... Default level: error · Added in 0.0.1-alpha.12 · Related issues · -View source +View source @@ -329,7 +329,7 @@ def test(): -> "Literal[5]": Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -359,7 +359,7 @@ class C(A, B): ... Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -385,7 +385,7 @@ t[3] # IndexError: tuple index out of range Default level: error · Added in 0.0.1-alpha.12 · Related issues · -View source +View source @@ -474,7 +474,7 @@ an atypical memory layout. Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -501,7 +501,7 @@ func("foo") # error: [invalid-argument-type] Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -529,7 +529,7 @@ a: int = '' Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -563,7 +563,7 @@ C.instance_var = 3 # error: Cannot assign to instance variable Default level: error · Added in 0.0.1-alpha.19 · Related issues · -View source +View source @@ -599,7 +599,7 @@ asyncio.run(main()) Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -623,7 +623,7 @@ class A(42): ... # error: [invalid-base] Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -650,7 +650,7 @@ with 1: Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -679,7 +679,7 @@ a: str Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -717,13 +717,55 @@ except ZeroDivisionError: This rule corresponds to Ruff's [`except-with-non-exception-classes` (`B030`)](https://docs.astral.sh/ruff/rules/except-with-non-exception-classes) +## `invalid-explicit-override` + + +Default level: error · +Added in 0.0.1-alpha.28 · +Related issues · +View source + + + +**What it does** + +Checks for methods that are decorated with `@override` but do not override any method in a superclass. + +**Why is this bad?** + +Decorating a method with `@override` declares to the type checker that the intention is that it should +override a method from a superclass. + +**Example** + + +```python +from typing import override + +class A: + @override + def foo(self): ... # Error raised here + +class B(A): + @override + def ffooo(self): ... # Error raised here + +class C: + @override + def __repr__(self): ... # fine: overrides `object.__repr__` + +class D(A): + @override + def foo(self): ... # fine: overrides `A.foo` +``` + ## `invalid-generic-class` Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -756,7 +798,7 @@ class C[U](Generic[T]): ... Default level: error · Added in 0.0.1-alpha.17 · Related issues · -View source +View source @@ -795,7 +837,7 @@ carol = Person(name="Carol", age=25) # typo! Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -830,7 +872,7 @@ def f(t: TypeVar("U")): ... Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -858,13 +900,99 @@ class B(metaclass=f): ... - [Python documentation: Metaclasses](https://docs.python.org/3/reference/datamodel.html#metaclasses) +## `invalid-method-override` + + +Default level: error · +Added in 0.0.1-alpha.20 · +Related issues · +View source + + + +**What it does** + +Detects method overrides that violate the [Liskov Substitution Principle] ("LSP"). + +The LSP states that an instance of a subtype should be substitutable for an instance of its supertype. +Applied to Python, this means: +1. All argument combinations a superclass method accepts + must also be accepted by an overriding subclass method. +2. The return type of an overriding subclass method must be a subtype + of the return type of the superclass method. + +**Why is this bad?** + +Violating the Liskov Substitution Principle will lead to many of ty's assumptions and +inferences being incorrect, which will mean that it will fail to catch many possible +type errors in your code. + +**Example** + +```python +class Super: + def method(self, x) -> int: + return 42 + +class Sub(Super): + # Liskov violation: `str` is not a subtype of `int`, + # but the supertype method promises to return an `int`. + def method(self, x) -> str: # error: [invalid-override] + return "foo" + +def accepts_super(s: Super) -> int: + return s.method(x=42) + +accepts_super(Sub()) # The result of this call is a string, but ty will infer + # it to be an `int` due to the violation of the Liskov Substitution Principle. + +class Sub2(Super): + # Liskov violation: the superclass method can be called with a `x=` + # keyword argument, but the subclass method does not accept it. + def method(self, y) -> int: # error: [invalid-override] + return 42 + +accepts_super(Sub2()) # TypeError at runtime: method() got an unexpected keyword argument 'x' + # ty cannot catch this error due to the violation of the Liskov Substitution Principle. +``` + +**Common issues** + + +**Why does ty complain about my `__eq__` method?** + + +`__eq__` and `__ne__` methods in Python are generally expected to accept arbitrary +objects as their second argument, for example: + +```python +class A: + x: int + + def __eq__(self, other: object) -> bool: + # gracefully handle an object of an unexpected type + # without raising an exception + if not isinstance(other, A): + return False + return self.x == other.x +``` + +If `A.__eq__` here were annotated as only accepting `A` instances for its second argument, +it would imply that you wouldn't be able to use `==` between instances of `A` and +instances of unrelated classes without an exception possibly being raised. While some +classes in Python do indeed behave this way, the strongly held convention is that it should +be avoided wherever possible. As part of this check, therefore, ty enforces that `__eq__` +and `__ne__` methods accept `object` as their second argument. + +[Liskov Substitution Principle]: https://en.wikipedia.org/wiki/Liskov_substitution_principle + ## `invalid-named-tuple` Default level: error · Added in 0.0.1-alpha.19 · Related issues · -View source +View source @@ -896,7 +1024,7 @@ TypeError: can only inherit from a NamedTuple type and Generic Default level: error · Preview (since 1.0.0) · Related issues · -View source +View source @@ -926,7 +1054,7 @@ Baz = NewType("Baz", int | str) # error: invalid base for `typing.NewType` Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -976,7 +1104,7 @@ def foo(x: int) -> int: ... Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1002,7 +1130,7 @@ def f(a: int = ''): ... Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1033,7 +1161,7 @@ P2 = ParamSpec("S2") # error: ParamSpec name must match the variable it's assig Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1067,7 +1195,7 @@ TypeError: Protocols can only inherit from other protocols, got Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1116,7 +1244,7 @@ def g(): Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1141,7 +1269,7 @@ def func() -> int: Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1199,7 +1327,7 @@ TODO #14889 Default level: error · Added in 0.0.1-alpha.6 · Related issues · -View source +View source @@ -1226,7 +1354,7 @@ NewAlias = TypeAliasType(get_name(), int) # error: TypeAliasType name mus Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1256,7 +1384,7 @@ TYPE_CHECKING = '' Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1286,7 +1414,7 @@ b: Annotated[int] # `Annotated` expects at least two arguments Default level: error · Added in 0.0.1-alpha.11 · Related issues · -View source +View source @@ -1320,7 +1448,7 @@ f(10) # Error Default level: error · Added in 0.0.1-alpha.11 · Related issues · -View source +View source @@ -1354,7 +1482,7 @@ class C: Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1389,7 +1517,7 @@ T = TypeVar('T', bound=str) # valid bound TypeVar Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1414,7 +1542,7 @@ func() # TypeError: func() missing 1 required positional argument: 'x' Default level: error · Added in 0.0.1-alpha.20 · Related issues · -View source +View source @@ -1447,7 +1575,7 @@ alice["age"] # KeyError Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1476,7 +1604,7 @@ func("string") # error: [no-matching-overload] Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1500,7 +1628,7 @@ Subscripting an object that does not support it will raise a `TypeError` at runt Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1526,7 +1654,7 @@ for i in 34: # TypeError: 'int' object is not iterable Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1553,7 +1681,7 @@ f(1, x=2) # Error raised here Default level: error · Added in 0.0.1-alpha.22 · Related issues · -View source +View source @@ -1611,7 +1739,7 @@ def test(): -> "int": Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1641,7 +1769,7 @@ static_assert(int(2.0 * 3.0) == 6) # error: does not have a statically known tr Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1670,7 +1798,7 @@ class B(A): ... # Error raised here Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1697,7 +1825,7 @@ f("foo") # Error raised here Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1725,7 +1853,7 @@ def _(x: int): Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1771,7 +1899,7 @@ class A: Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1798,7 +1926,7 @@ f(x=1, y=2) # Error raised here Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1826,7 +1954,7 @@ A().foo # AttributeError: 'A' object has no attribute 'foo' Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1851,7 +1979,7 @@ import foo # ModuleNotFoundError: No module named 'foo' Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1876,7 +2004,7 @@ print(x) # NameError: name 'x' is not defined Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1913,7 +2041,7 @@ b1 < b2 < b1 # exception raised here Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1941,7 +2069,7 @@ A() + A() # TypeError: unsupported operand type(s) for +: 'A' and 'A' Default level: error · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -1966,7 +2094,7 @@ l[1:10:0] # ValueError: slice step cannot be zero Default level: warn · Added in 0.0.1-alpha.20 · Related issues · -View source +View source @@ -2007,7 +2135,7 @@ class SubProto(BaseProto, Protocol): Default level: warn · Added in 0.0.1-alpha.16 · Related issues · -View source +View source @@ -2034,7 +2162,7 @@ old_func() # emits [deprecated] diagnostic Default level: warn · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -2065,7 +2193,7 @@ a = 20 / 0 # ty: ignore[division-by-zero] Default level: warn · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -2095,7 +2223,7 @@ a = 20 / 0 # type: ignore Default level: warn · Added in 0.0.1-alpha.22 · Related issues · -View source +View source @@ -2123,7 +2251,7 @@ A.c # AttributeError: type object 'A' has no attribute 'c' Default level: warn · Added in 0.0.1-alpha.22 · Related issues · -View source +View source @@ -2155,7 +2283,7 @@ A()[0] # TypeError: 'A' object is not subscriptable Default level: warn · Added in 0.0.1-alpha.22 · Related issues · -View source +View source @@ -2187,7 +2315,7 @@ from module import a # ImportError: cannot import name 'a' from 'module' Default level: warn · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -2214,7 +2342,7 @@ cast(int, f()) # Redundant Default level: warn · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -2238,7 +2366,7 @@ reveal_type(1) # NameError: name 'reveal_type' is not defined Default level: warn · Added in 0.0.1-alpha.15 · Related issues · -View source +View source @@ -2296,7 +2424,7 @@ def g(): Default level: warn · Added in 0.0.1-alpha.7 · Related issues · -View source +View source @@ -2335,7 +2463,7 @@ class D(C): ... # error: [unsupported-base] Default level: warn · Added in 0.0.1-alpha.22 · Related issues · -View source +View source @@ -2398,7 +2526,7 @@ def foo(x: int | str) -> int | str: Default level: ignore · Preview (since 0.0.1-alpha.1) · Related issues · -View source +View source @@ -2422,7 +2550,7 @@ Dividing by zero raises a `ZeroDivisionError` at runtime. Default level: ignore · Added in 0.0.1-alpha.1 · Related issues · -View source +View source @@ -2450,7 +2578,7 @@ print(x) # NameError: name 'x' is not defined Default level: ignore · Added in 0.0.1-alpha.1 · Related issues · -View source +View source diff --git a/pyproject.toml b/pyproject.toml index 8e50c56f84..a5a6e3487e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ty" -version = "0.0.1a27" +version = "0.0.1a28" requires-python = ">=3.8" dependencies = [] description = "An extremely fast Python type checker, written in Rust." diff --git a/ruff b/ruff index 62343a101a..81c97e9e94 160000 --- a/ruff +++ b/ruff @@ -1 +1 @@ -Subproject commit 62343a101a44bcd5acfd23a55beb8b2e7f701809 +Subproject commit 81c97e9e9437ae68e23c047e4c6fb2abcf0c80d6 diff --git a/uv.lock b/uv.lock index 63e0103ae1..53327b1387 100644 --- a/uv.lock +++ b/uv.lock @@ -624,7 +624,7 @@ wheels = [ [[package]] name = "ty" -version = "0.0.1a27" +version = "0.0.1a28" source = { editable = "." } [package.dev-dependencies] From b4d2d343eeb8907a64b17e827af29b1821323573 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 25 Nov 2025 12:18:57 -0800 Subject: [PATCH 02/15] CHANGELOG formatting --- CHANGELOG.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bdd223fca..92608cc464 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,24 +11,24 @@ Released on 2025-11-25. ### LSP server -- Add 'remove unused ignore comment' code action ([#21582](https://github.com/astral-sh/ruff/pull/21582)) +- Add "remove unused ignore comment" code action ([#21582](https://github.com/astral-sh/ruff/pull/21582)) - Add goto for `Unknown` when it appears in an inlay hint ([#21545](https://github.com/astral-sh/ruff/pull/21545)) - Add more random TypeDetails and tests ([#21546](https://github.com/astral-sh/ruff/pull/21546)) - Add type definitions for `Type::SpecialForm`s ([#21544](https://github.com/astral-sh/ruff/pull/21544)) - Don't suggest things that aren't subclasses of `BaseException` after `raise` ([#21571](https://github.com/astral-sh/ruff/pull/21571)) -- Double click to insert inlay hint ([#21600](https://github.com/astral-sh/ruff/pull/21600)) +- Implement double click to insert inlay hint ([#21600](https://github.com/astral-sh/ruff/pull/21600)) - Fix edge cases for autocomplete suppressions in variable bindings ([#21576](https://github.com/astral-sh/ruff/pull/21576)) - Implement docstring rendering to markdown ([#21550](https://github.com/astral-sh/ruff/pull/21550)) -- Implement goto-definition and find-references for global/nonlocal statements ([#21616](https://github.com/astral-sh/ruff/pull/21616)) +- Implement goto-definition and find-references for `global`/`nonlocal` statements ([#21616](https://github.com/astral-sh/ruff/pull/21616)) - Implement goto-type for inlay type hints ([#21533](https://github.com/astral-sh/ruff/pull/21533)) -- Implement lsp support for string annotations ([#21577](https://github.com/astral-sh/ruff/pull/21577)) +- Support string annotations ([#21577](https://github.com/astral-sh/ruff/pull/21577)) - Improve import detection for completions and support `from ...` completions ([#21547](https://github.com/astral-sh/ruff/pull/21547)) -- Improve lsp handling of hover/goto on imports ([#21572](https://github.com/astral-sh/ruff/pull/21572)) -- Inlay Hint edit follow up ([#21621](https://github.com/astral-sh/ruff/pull/21621)) -- More low-hanging fruit for inlay hint goto-definition ([#21548](https://github.com/astral-sh/ruff/pull/21548)) +- Improve handling of hover/goto on imports ([#21572](https://github.com/astral-sh/ruff/pull/21572)) +- Don't allow edits of some more invalid syntax types in inlay hints ([#21621](https://github.com/astral-sh/ruff/pull/21621)) +- Improve inlay hint goto-definition ([#21548](https://github.com/astral-sh/ruff/pull/21548)) - Resolve overloads for hovers ([#21417](https://github.com/astral-sh/ruff/pull/21417)) -- Semantic tokens: consistently add the `DEFINITION` modifier ([#21521](https://github.com/astral-sh/ruff/pull/21521)) -- suppress autocomplete suggestions during variable binding ([#21549](https://github.com/astral-sh/ruff/pull/21549)) +- Consistently add the `DEFINITION` modifier when computing semantic tokens ([#21521](https://github.com/astral-sh/ruff/pull/21521)) +- Suppress autocomplete suggestions during variable binding ([#21549](https://github.com/astral-sh/ruff/pull/21549)) ### CLI @@ -53,11 +53,11 @@ Released on 2025-11-25. - Retain the function-like-ness of `Callable` types when binding `self` ([#21614](https://github.com/astral-sh/ruff/pull/21614)) - Substitute for `typing.Self` when checking protocol members ([#21569](https://github.com/astral-sh/ruff/pull/21569)) - Switch the error code from `unresolved-attribute` to `possibly-missing-attribute` for submodules that may not be available ([#21618](https://github.com/astral-sh/ruff/pull/21618)) -- implement `TypedDict` structural assignment ([#21467](https://github.com/astral-sh/ruff/pull/21467)) -- make implicit submodule imports re-exported ([#21573](https://github.com/astral-sh/ruff/pull/21573)) -- support PEP 613 type aliases ([#21394](https://github.com/astral-sh/ruff/pull/21394)) -- support generic aliases in `type[...]`, like `type[C[int]]` ([#21552](https://github.com/astral-sh/ruff/pull/21552)) -- tighten up handling of subscripts in type expressions ([#21503](https://github.com/astral-sh/ruff/pull/21503)) +- Implement `TypedDict` structural assignment ([#21467](https://github.com/astral-sh/ruff/pull/21467)) +- Make implicit submodule imports re-exported ([#21573](https://github.com/astral-sh/ruff/pull/21573)) +- Support PEP 613 type aliases ([#21394](https://github.com/astral-sh/ruff/pull/21394)) +- Support generic aliases in `type[...]`, like `type[C[int]]` ([#21552](https://github.com/astral-sh/ruff/pull/21552)) +- Tighten up handling of subscripts in type expressions ([#21503](https://github.com/astral-sh/ruff/pull/21503)) ### Contributors From 1cc471ed93a5df3cae43a85253b4b0c49ac5e080 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 25 Nov 2025 13:48:37 -0800 Subject: [PATCH 03/15] remove extra edits to the CHANGELOG These happened because I didn't have the pre-commit hooks installed. --- CHANGELOG.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92608cc464..1a52658905 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -994,18 +994,18 @@ Released on 2025-10-10. - Add cycle detection to ty's implementation of disjointness between types, fixing a possible source of stack overflows when analysing recursive types ([#19139](https://github.com/astral-sh/ruff/pull/19139)) - Don't allow first-party code to shadow the stdlib `types` module ([#19128](https://github.com/astral-sh/ruff/pull/19128)). -This fixes another possible source of stack overflows. + This fixes another possible source of stack overflows. - Fix descriptor lookups for most types that overlap with `None` ([#19120](https://github.com/astral-sh/ruff/pull/19120)). -This means that e.g. `object().__str__()` now correctly binds the `self` argument of the `__str__` -method, as the `object` type overlaps with `None`. + This means that e.g. `object().__str__()` now correctly binds the `self` argument of the `__str__` + method, as the `object` type overlaps with `None`. ### Server - Filter a symbol from a stub file in autocomplete suggestions if it is an implementation detail of the stub ([#19121](https://github.com/astral-sh/ruff/pull/19121)) - Add initial support for [semantic tokens](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens) ([#19108](https://github.com/astral-sh/ruff/pull/19108)). -This feature allows editors to apply more advanced syntax highlighting. Currently, the supported tokens are: `Namespace`, `Class`, `Parameter`, `SelfParameter`,`ClsParameter`, `Variable`, `Property`, `Function`, `Method`, `Keyword`, `String`, `Number`, `Decorator`, `BuiltinConstant` and `TypeParameter`. + This feature allows editors to apply more advanced syntax highlighting. Currently, the supported tokens are: `Namespace`, `Class`, `Parameter`, `SelfParameter`,`ClsParameter`, `Variable`, `Property`, `Function`, `Method`, `Keyword`, `String`, `Number`, `Decorator`, `BuiltinConstant` and `TypeParameter`. - Initial support for [workspace diagnostics](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_diagnostic) ([#18939](https://github.com/astral-sh/ruff/pull/18939)). -Enable this feature by setting the `ty.diagnosticMode` configuration setting to `"workspace"`. + Enable this feature by setting the `ty.diagnosticMode` configuration setting to `"workspace"`. - Use Python syntax highlighting in on-hover content ([#19082](https://github.com/astral-sh/ruff/pull/19082)) ### Typing semantics and features @@ -1195,7 +1195,7 @@ Enable this feature by setting the `ty.diagnosticMode` configuration setting to ### Bug fixes - Delay computation of 'unbound' visibility for implicit instance attributes ([#18669](https://github.com/astral-sh/ruff/pull/18669)). -This fixes a significant performance regression in version 0.0.1-alpha.9. + This fixes a significant performance regression in version 0.0.1-alpha.9. ### Typing semantics and features From 47b6ad04258335134238578f2abe2a7e41f219a0 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 25 Nov 2025 13:50:59 -0800 Subject: [PATCH 04/15] mention installing the pre-commit hooks in the list of release steps --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c3985fc721..59d0355323 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -138,6 +138,8 @@ Releases can only be performed by Astral team members. Preparation for the release is automated. +1. Install the pre-commit hooks as described above, if you haven't already. + 1. Checkout the `main` branch and run `git pull origin main --recurse-submodules --tags`. 1. Create and checkout a new branch for the release. From f59d0660303219353e0363b84cdbc62b7ab9f4dd Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 25 Nov 2025 13:51:35 -0800 Subject: [PATCH 05/15] Update CHANGELOG.md Co-authored-by: Carl Meyer --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a52658905..f0ac8c1b35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ Released on 2025-11-25. ### LSP server - Add "remove unused ignore comment" code action ([#21582](https://github.com/astral-sh/ruff/pull/21582)) -- Add goto for `Unknown` when it appears in an inlay hint ([#21545](https://github.com/astral-sh/ruff/pull/21545)) +- Add go-to-definition for `Unknown` when it appears in an inlay hint ([#21545](https://github.com/astral-sh/ruff/pull/21545)) - Add more random TypeDetails and tests ([#21546](https://github.com/astral-sh/ruff/pull/21546)) - Add type definitions for `Type::SpecialForm`s ([#21544](https://github.com/astral-sh/ruff/pull/21544)) - Don't suggest things that aren't subclasses of `BaseException` after `raise` ([#21571](https://github.com/astral-sh/ruff/pull/21571)) From eb6e81b950ea1b85f54d4517de04a1da1223ddf4 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 25 Nov 2025 13:51:42 -0800 Subject: [PATCH 06/15] Update CHANGELOG.md Co-authored-by: Carl Meyer --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0ac8c1b35..9d1a1fe8fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ Released on 2025-11-25. - Add "remove unused ignore comment" code action ([#21582](https://github.com/astral-sh/ruff/pull/21582)) - Add go-to-definition for `Unknown` when it appears in an inlay hint ([#21545](https://github.com/astral-sh/ruff/pull/21545)) -- Add more random TypeDetails and tests ([#21546](https://github.com/astral-sh/ruff/pull/21546)) +- Add go-to-definition support for more types ([#21546](https://github.com/astral-sh/ruff/pull/21546)) - Add type definitions for `Type::SpecialForm`s ([#21544](https://github.com/astral-sh/ruff/pull/21544)) - Don't suggest things that aren't subclasses of `BaseException` after `raise` ([#21571](https://github.com/astral-sh/ruff/pull/21571)) - Implement double click to insert inlay hint ([#21600](https://github.com/astral-sh/ruff/pull/21600)) From 9bfba7a878e82d3e77f7d0fd1b34d64945ffe23c Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 25 Nov 2025 13:51:49 -0800 Subject: [PATCH 07/15] Update CHANGELOG.md Co-authored-by: Carl Meyer --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d1a1fe8fd..28af8f716a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ Released on 2025-11-25. - Add "remove unused ignore comment" code action ([#21582](https://github.com/astral-sh/ruff/pull/21582)) - Add go-to-definition for `Unknown` when it appears in an inlay hint ([#21545](https://github.com/astral-sh/ruff/pull/21545)) - Add go-to-definition support for more types ([#21546](https://github.com/astral-sh/ruff/pull/21546)) -- Add type definitions for `Type::SpecialForm`s ([#21544](https://github.com/astral-sh/ruff/pull/21544)) +- Add go-to-definition support for typing special forms ([#21544](https://github.com/astral-sh/ruff/pull/21544)) - Don't suggest things that aren't subclasses of `BaseException` after `raise` ([#21571](https://github.com/astral-sh/ruff/pull/21571)) - Implement double click to insert inlay hint ([#21600](https://github.com/astral-sh/ruff/pull/21600)) - Fix edge cases for autocomplete suppressions in variable bindings ([#21576](https://github.com/astral-sh/ruff/pull/21576)) From a7424764752c109522a8ab0253c20ed0df334d0b Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 25 Nov 2025 13:51:57 -0800 Subject: [PATCH 08/15] Update CHANGELOG.md Co-authored-by: Carl Meyer --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28af8f716a..7992264e09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ Released on 2025-11-25. - Add go-to-definition for `Unknown` when it appears in an inlay hint ([#21545](https://github.com/astral-sh/ruff/pull/21545)) - Add go-to-definition support for more types ([#21546](https://github.com/astral-sh/ruff/pull/21546)) - Add go-to-definition support for typing special forms ([#21544](https://github.com/astral-sh/ruff/pull/21544)) -- Don't suggest things that aren't subclasses of `BaseException` after `raise` ([#21571](https://github.com/astral-sh/ruff/pull/21571)) +- Don't suggest completions that aren't subclasses of `BaseException` after `raise` ([#21571](https://github.com/astral-sh/ruff/pull/21571)) - Implement double click to insert inlay hint ([#21600](https://github.com/astral-sh/ruff/pull/21600)) - Fix edge cases for autocomplete suppressions in variable bindings ([#21576](https://github.com/astral-sh/ruff/pull/21576)) - Implement docstring rendering to markdown ([#21550](https://github.com/astral-sh/ruff/pull/21550)) From e89b4b085e04be1b8b080ea20a07935917f5fc85 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 25 Nov 2025 13:52:14 -0800 Subject: [PATCH 09/15] Update CHANGELOG.md Co-authored-by: Carl Meyer --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7992264e09..2b57e1bee0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ Released on 2025-11-25. - Improve handling of hover/goto on imports ([#21572](https://github.com/astral-sh/ruff/pull/21572)) - Don't allow edits of some more invalid syntax types in inlay hints ([#21621](https://github.com/astral-sh/ruff/pull/21621)) - Improve inlay hint goto-definition ([#21548](https://github.com/astral-sh/ruff/pull/21548)) -- Resolve overloads for hovers ([#21417](https://github.com/astral-sh/ruff/pull/21417)) +- Resolve applicable overloads for hover on an overloaded function call ([#21417](https://github.com/astral-sh/ruff/pull/21417)) - Consistently add the `DEFINITION` modifier when computing semantic tokens ([#21521](https://github.com/astral-sh/ruff/pull/21521)) - Suppress autocomplete suggestions during variable binding ([#21549](https://github.com/astral-sh/ruff/pull/21549)) From 925efa7ad8664f682a52d1a4e2a15284e1f83263 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 25 Nov 2025 13:52:25 -0800 Subject: [PATCH 10/15] Update CHANGELOG.md Co-authored-by: Carl Meyer --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b57e1bee0..9423da59b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,7 @@ Released on 2025-11-25. ### CLI -- Exit with `2` if there's any IO error ([#21508](https://github.com/astral-sh/ruff/pull/21508)) +- Exit with code `2` if there's any IO error ([#21508](https://github.com/astral-sh/ruff/pull/21508)) ### Other changes From 0b1c7fff1ad3c5c352a55d1a808a31f570c619f0 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 25 Nov 2025 13:52:32 -0800 Subject: [PATCH 11/15] Update CHANGELOG.md Co-authored-by: Carl Meyer --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9423da59b8..d7478d1190 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,7 +38,7 @@ Released on 2025-11-25. - Add hint about resolved Python version when a user attempts to import a member added on a newer version ([#21615](https://github.com/astral-sh/ruff/pull/21615)) - Attach subdiagnostics to `unresolved-import` errors for relative imports as well as absolute imports ([#21554](https://github.com/astral-sh/ruff/pull/21554)) -- Avoid expression reinference for diagnostics ([#21267](https://github.com/astral-sh/ruff/pull/21267)) +- Avoid expression re-inference for diagnostics ([#21267](https://github.com/astral-sh/ruff/pull/21267)) - Check method definitions on subclasses for Liskov violations ([#21436](https://github.com/astral-sh/ruff/pull/21436)) - Eagerly evaluate `types.UnionType` elements as type expressions ([#21531](https://github.com/astral-sh/ruff/pull/21531)) - Extend Liskov checks to also cover classmethods and staticmethods ([#21598](https://github.com/astral-sh/ruff/pull/21598)) From bc19d98eb0d0597dce5563f4ea6b86c226ceffcd Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 25 Nov 2025 13:52:37 -0800 Subject: [PATCH 12/15] Update CHANGELOG.md Co-authored-by: Carl Meyer --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7478d1190..bec904f3a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,7 +55,7 @@ Released on 2025-11-25. - Switch the error code from `unresolved-attribute` to `possibly-missing-attribute` for submodules that may not be available ([#21618](https://github.com/astral-sh/ruff/pull/21618)) - Implement `TypedDict` structural assignment ([#21467](https://github.com/astral-sh/ruff/pull/21467)) - Make implicit submodule imports re-exported ([#21573](https://github.com/astral-sh/ruff/pull/21573)) -- Support PEP 613 type aliases ([#21394](https://github.com/astral-sh/ruff/pull/21394)) +- Support PEP 613 `typing.TypeAlias` type aliases ([#21394](https://github.com/astral-sh/ruff/pull/21394)) - Support generic aliases in `type[...]`, like `type[C[int]]` ([#21552](https://github.com/astral-sh/ruff/pull/21552)) - Tighten up handling of subscripts in type expressions ([#21503](https://github.com/astral-sh/ruff/pull/21503)) From bbcb5f2ff04eb87e9492c83ee6cad947aee2ac9e Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 25 Nov 2025 14:10:00 -0800 Subject: [PATCH 13/15] fix an errant space --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bec904f3a9..89e257a8ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ Released on 2025-11-25. - Add "remove unused ignore comment" code action ([#21582](https://github.com/astral-sh/ruff/pull/21582)) - Add go-to-definition for `Unknown` when it appears in an inlay hint ([#21545](https://github.com/astral-sh/ruff/pull/21545)) - Add go-to-definition support for more types ([#21546](https://github.com/astral-sh/ruff/pull/21546)) -- Add go-to-definition support for typing special forms ([#21544](https://github.com/astral-sh/ruff/pull/21544)) +- Add go-to-definition support for typing special forms ([#21544](https://github.com/astral-sh/ruff/pull/21544)) - Don't suggest completions that aren't subclasses of `BaseException` after `raise` ([#21571](https://github.com/astral-sh/ruff/pull/21571)) - Implement double click to insert inlay hint ([#21600](https://github.com/astral-sh/ruff/pull/21600)) - Fix edge cases for autocomplete suppressions in variable bindings ([#21576](https://github.com/astral-sh/ruff/pull/21576)) From e1ebb3182e50f66fd26169b7792fdd99d7b5e5b4 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 25 Nov 2025 14:18:39 -0800 Subject: [PATCH 14/15] hotfix https://github.com/astral-sh/ruff/pull/21632 This fixes a feature that's shipping in this release, so it won't get a separate mention in the CHANGELOG. --- ruff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruff b/ruff index 81c97e9e94..5364256190 160000 --- a/ruff +++ b/ruff @@ -1 +1 @@ -Subproject commit 81c97e9e9437ae68e23c047e4c6fb2abcf0c80d6 +Subproject commit 536425619018d5531d7e5d5f66918735a8583724 From dd3ae3ddd99a40fe0ab63183efe9a328ef287c14 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 25 Nov 2025 15:55:40 -0800 Subject: [PATCH 15/15] Alex's suggestions --- CHANGELOG.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89e257a8ed..ee2e13317c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,25 +7,25 @@ Released on 2025-11-25. ### Bug fixes - Fix panic for unclosed string literal in type annotation position ([#21592](https://github.com/astral-sh/ruff/pull/21592)) -- Fix subtraction overflow bug ([#21570](https://github.com/astral-sh/ruff/pull/21570)) ### LSP server +- Improve go-to-definition and add go-to-definition for inlay hints + ([#21545](https://github.com/astral-sh/ruff/pull/21545), + [#21546](https://github.com/astral-sh/ruff/pull/21546), + [#21544](https://github.com/astral-sh/ruff/pull/21544), + [#21616](https://github.com/astral-sh/ruff/pull/21616), + [#21548](https://github.com/astral-sh/ruff/pull/21548)) +- Implement go-to-type for inlay type hints ([#21533](https://github.com/astral-sh/ruff/pull/21533)) - Add "remove unused ignore comment" code action ([#21582](https://github.com/astral-sh/ruff/pull/21582)) -- Add go-to-definition for `Unknown` when it appears in an inlay hint ([#21545](https://github.com/astral-sh/ruff/pull/21545)) -- Add go-to-definition support for more types ([#21546](https://github.com/astral-sh/ruff/pull/21546)) -- Add go-to-definition support for typing special forms ([#21544](https://github.com/astral-sh/ruff/pull/21544)) - Don't suggest completions that aren't subclasses of `BaseException` after `raise` ([#21571](https://github.com/astral-sh/ruff/pull/21571)) - Implement double click to insert inlay hint ([#21600](https://github.com/astral-sh/ruff/pull/21600)) - Fix edge cases for autocomplete suppressions in variable bindings ([#21576](https://github.com/astral-sh/ruff/pull/21576)) - Implement docstring rendering to markdown ([#21550](https://github.com/astral-sh/ruff/pull/21550)) -- Implement goto-definition and find-references for `global`/`nonlocal` statements ([#21616](https://github.com/astral-sh/ruff/pull/21616)) -- Implement goto-type for inlay type hints ([#21533](https://github.com/astral-sh/ruff/pull/21533)) - Support string annotations ([#21577](https://github.com/astral-sh/ruff/pull/21577)) - Improve import detection for completions and support `from ...` completions ([#21547](https://github.com/astral-sh/ruff/pull/21547)) - Improve handling of hover/goto on imports ([#21572](https://github.com/astral-sh/ruff/pull/21572)) - Don't allow edits of some more invalid syntax types in inlay hints ([#21621](https://github.com/astral-sh/ruff/pull/21621)) -- Improve inlay hint goto-definition ([#21548](https://github.com/astral-sh/ruff/pull/21548)) - Resolve applicable overloads for hover on an overloaded function call ([#21417](https://github.com/astral-sh/ruff/pull/21417)) - Consistently add the `DEFINITION` modifier when computing semantic tokens ([#21521](https://github.com/astral-sh/ruff/pull/21521)) - Suppress autocomplete suggestions during variable binding ([#21549](https://github.com/astral-sh/ruff/pull/21549))