Skip to content

"Go to Definition" for keyword arguments in function call #1881

@injust

Description

@injust

basedpyright (I tested in Zed) supports "Go to Definition" (cmd-click or F12) for argument names in a function call.

In ty, this is currently a no-op, so you have to use "Go to Definition" on the function, and then find the parameter in its type signature.

Supporting argument names is useful for this pattern, which is used in types-boto3:

class BarTypeDef(TypedDict):
    thing: str


def foo(**kwargs: Unpack[BarTypeDef]) -> None:
    pass


foo(thing="abcd")
#   ^^^^^ cmd-click here

In basedpyright, "Go to Definition" on thing takes you to its definition in BarTypeDef.

Metadata

Metadata

Assignees

No one assigned

    Labels

    serverRelated to the LSP server

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions