Skip to content

goto-type for SpecialForms #1601

@Gankra

Description

@Gankra

Point of terminology: goto-definition, goto-declaration, and goto-type are 3 different operations with very similar behaviour. cmd+click prefers those options in that order, if they have a result. goto-type has been a bit neglected because it's the last in the chain, and so users largely don't interact with it.

Image

Now that inlay-hints are clickable with goto-type semantics, users are way more exposed to goto-type, and so the random places where goto-type fails out are way more noticeable.

goto-type is just a thin wrapper around Type::definition:

https://github.com/astral-sh/ruff/blob/416e2267daaf9699c26ec73c644a03356e3de7f2/crates/ty_python_semantic/src/types.rs#L7553

Notably all SpecialForms yield None, which means e.g. you can't click on Literal in an inlay hint, even though it would be nice for it to go to typing.Literal's definition (where we could potentially have docs explaining Literals In General).

Metadata

Metadata

Assignees

No one assigned

    Labels

    serverRelated to the LSP server

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions