[ty] More low-hanging fruit for inlay hint goto-definition by AlexWaygood · Pull Request #21548 · astral-sh/ruff (original) (raw)
dcreager added a commit that referenced this pull request
…d-typevar
- origin/main: (24 commits)
[ty] Remove brittle constraint set reveal tests (#21568)
[
ruff] Catch more dummy variable uses (RUF052) (#19799) [ty] Use the same snapshot handling as other tests (#21564) [ty] suppress autocomplete suggestions during variable binding (#21549) Set severity for non-rule diagnostics (#21559) [ty] Addwith_typeconvenience to display code (#21563) [ty] Implement docstring rendering to markdown (#21550) [ty] Reduce indentation ofTypeInferenceBuilder::infer_attribute_load(#21560) Bump 0.14.6 (#21558) [ty] Improve debug messages when imports fail (#21555) [ty] Add support for relative import completions [ty] Refactor detection of import statements for completions [ty] Use dedicated collector for completions [ty] Attach subdiagnostics tounresolved-importerrors for relative imports as well as absolute imports (#21554) [ty] support PEP 613 type aliases (#21394) [ty] More low-hanging fruit for inlay hint goto-definition (#21548) [ty] implementTypedDictstructural assignment (#21467) [ty] Add more random TypeDetails and tests (#21546) [ty] Add goto forUnknownwhen it appears in an inlay hint (#21545) [ty] Add type definitions forType::SpecialForms (#21544) ...
This was referenced
May 22, 2026
MichaReiser added a commit that referenced this pull request
Summary
Today, ty showed the hover for str when hovering the inlay of a
LiteralString type:
from typing import LiteralString
def my_func(x: LiteralString):
y[: LiteralString] = x
my_func(x="hello")Hovering the inlay of y ([: LiteralString] is the inlay) showed the
hover of str.
We argued in #21548 that str is
generally the more useful type in this position. I sort of agree, but I
think it's more important that the inlay and the hover show the same
type. I also think that it's important that the hover is consistent with
when we "bake" the inlay, e.g. hovering LiteralString now also shows
LiteralString and not str
from typing import LiteralString
def my_func(x: LiteralString):
y: LiteralString = x
my_func(x="hello")Closes astral-sh/ty#2860
Test Plan
Updated test
anishgirianish pushed a commit to anishgirianish/ruff that referenced this pull request
Summary
Today, ty showed the hover for str when hovering the inlay of a
LiteralString type:
from typing import LiteralString
def my_func(x: LiteralString):
y[: LiteralString] = x
my_func(x="hello")Hovering the inlay of y ([: LiteralString] is the inlay) showed the
hover of str.
We argued in astral-sh#21548 that str is
generally the more useful type in this position. I sort of agree, but I
think it's more important that the inlay and the hover show the same
type. I also think that it's important that the hover is consistent with
when we "bake" the inlay, e.g. hovering LiteralString now also shows
LiteralString and not str
from typing import LiteralString
def my_func(x: LiteralString):
y: LiteralString = x
my_func(x="hello")Closes astral-sh/ty#2860
Test Plan
Updated test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})