Skip to content

daemon command to display the file and line/column of the place where a symbol is defined #21762

Description

@bzoracler

Feature

I'd like to see a dmypy command (e.g. dmypy find fully.qualified.name or dmypy find /path/to/file:line:column:end_line:end_column) that then displays the /path/to/file:line:column of the original definition of a symbol.

Pitch

This is primarily motivated by enabling deeper editor integrations to allow jumping to a definition in the same file or another file. The output would simply look like

dmypy find builtins.int
/path/to/site-packages/mypy/typeshed/stdlib/builtins.pyi:254:0:362:57
dmypy find builtins.int --json
{"file": "/path/to/site-packages/mypy/typeshed/stdlib/builtins.pyi", "line": 254, "column": 0, "end_line": 362, "end_column": 57}

and the editor would parse the output to allow jumping to the definition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions