Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] Mark "X" in from ___ import ___ as X as a "Definition" #2274

Open
michaelblyons opened this issue Feb 13, 2020 · 2 comments
Open

[Python] Mark "X" in from ___ import ___ as X as a "Definition" #2274

michaelblyons opened this issue Feb 13, 2020 · 2 comments
Labels
C: Syntax T: enhancement Improvement of existing language features

Comments

@michaelblyons
Copy link
Collaborator

  • Sublime Version: 4065
  • OS Version: MacOS 10.15.3
from module import thing as alias

alias('foo')
alias('bar')

Hovering over alias on one of the bottom lines will show a popup with a "References" section that links to the other bottom one.

Expected behavior

It'd be great if there was also a "Definitions" section in the popup that linked to the alias on the first line. Ideally, it would be a definition for the one file. (i.e. alias in other files would not find it.)

If I hadn't given thing an alias, uses of thing would be linked to the thing definition in module.py, but there isn't any definition for alias apart from the import as.

Actual behavior

Understandably, there is no Definitions section currently in the popup.

@FichteFoll
Copy link
Collaborator

Depends on #1842.

@deathaxe
Copy link
Collaborator

The question here is how to distinguish module imports from functions etc.

thing could be anything - a module, function, variable. Don't think it's useful to just scope it entity.name without being able to properly link it with references.

@deathaxe deathaxe added the T: enhancement Improvement of existing language features label Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Syntax T: enhancement Improvement of existing language features
Projects
None yet
Development

No branches or pull requests

3 participants