Skip to content

Goto-type and hover-type for non-expression nodes (identifiers in statements) #144

@MichaReiser

Description

@MichaReiser

astral-sh/ruff#16901 implemented basic goto type definition support. However, there are still a handful of nodes that have identifier children for which goto type definition doesn't work because the enclosing node isn't an expression or a definition. We should add support for goto type definition for those nodes as well.

See the TODO comments in ty_ide::goto::GotoTarget::inferred_type

Status:

  • goto-declaration
  • goto-definition
  • find-references
  • rename (caveat: rename doesn't work for imports from third-party files #1661)
  • hover (caveat: we do not display the type on hover, limited by goto-type)
  • goto-type
    • imports
    • global/nonlocal - needs type inference changes to compute+record the type
    • match patterns - needs type inference changes to compute+record the type
    • type params (? should we even do anything here)

Metadata

Metadata

Assignees

No one assigned

    Labels

    serverRelated to the LSP server

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions