Skip to content

"Go to definition" on module takes you to __init__.py instead of actual module #3519

Closed

Description

Environment data

  • VS Code version: 1.29.1
  • Extension version (available under the Extensions sidebar): 2018.11.0
  • OS and version: Windows 10 64-bit
  • Python version (& distribution if applicable, e.g. Anaconda): Conda 3.7.1
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: None

Actual behavior

"Go to definition" on module takes me to __init__.py rather than the module I actually selected.

Expected behavior

"Go to definition" on module takes me to the module I selected.

Steps to reproduce:

Using the jedi language engine:

gotodef_debug

Logs

Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

# there is no output, as seen in the screencap above

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

# there is no output, as seen in the screencap above

Activity

  1. d3r3kk commented on Nov 30, 2018

    @d3r3kk

    Fredrik Averpil (@fredrikaverpil) thanks for the report.

    Could you please try the new Python Language Server and let us know if the behaviour persists? You can do this by going into settings (Ctrl+,) and unchecking Python: Jedi Enabled, then reload VSCode.

  2. fredrikaverpil commented on Dec 3, 2018

    @fredrikaverpil
    Author

    Hey Derek Keeler (@d3r3kk)

    When I enable the MS Python Language Server it's actually even worse. Now I can't even go to the definition of the hello function, which works if using jedi. See screenshots when I attempt the "gotodef" for both the module and the function, both resulting in "No definition found for 'hello'".

    image

    image

  3. d3r3kk commented on Jan 7, 2019

    @d3r3kk

    Interesting, I cannot seem to replicate the issue at all with the Python Language Server:

    3519_ms_python_lang_server_code_nav

    Could you please retry with the latest Python Language Server and let us know if things have improved on your end?

    I can reproduce this with Jedi however, and worse yet, our 'insiders' build seems to fail altogether with code navigation in this regard (we've updated to a newer version of Jedi for insiders). I'm marking this as a Jedi bug and something to track before we release.

  4. d3r3kk commented on Jan 7, 2019

    @d3r3kk

    Here's the results on our insiders build with the latest Jedi:

    3519_jedi_insiders_lang_server_code_nav

  5. d3r3kk commented on Jan 7, 2019

    @d3r3kk
  6. removed their assignment
    on Jan 7, 2019
  7. 11 remaining items

  8. DonJayamanne commented on Jan 31, 2019

    @DonJayamanne

    Unable to replicate in the latest version of Jedi and parso, hence we should upgrade.

  9. russelldavis commented on Feb 7, 2019

    @russelldavis

    Don Jayamanne (@DonJayamanne) I started putting together a PR to upgrade to the latest version of Jedi and parso to fix this issue, but even with the new versions, I am still able to reproduce the bug (in VSCode 1.31.0 as well as the insiders build). It's the issue shown in Fredrik Averpil (@fredrikaverpil)'s gif above.

  10. brettcannon commented on Dec 20, 2019

    @brettcannon
    Member

    Is this still an issue for anyone?

  11. fredrikaverpil commented on Dec 21, 2019

    @fredrikaverpil
    Author

    Brett Cannon (@brettcannon) I cannot reproduce this anymore in vscode 1.41.1. To me, this issue seems completely fixed. I've tested the same case as above with both jedi and the python language server! 👍 🎉

  12. locked as resolved and limited conversation to collaborators on Dec 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-editor-*User-facing catch-allbugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions