python / python/mypy

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

Open
#21,762 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the dmypy command entry point and trace how symbol definitions and source positions are available through the daemon. Check the existing command and response conventions before deciding how the plain-text and --json forms should be represented; done means both example lookup forms return the original definition range for a symbol.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.