Skip to content

Go to Definition erratic behavior  #13751

Closed

Description

@weberxw

I'm programming python and Django and When I ctrl + click or F12 (go to definition) on some imported class from another file, like the screenshot example bellow, this took beetwen 5 to 10 seconds to open the file and sometimes nothing happens and I have to crl+click again and await again. I've tried to change from Jedi to pylance or microsoft but nothing helps.

On the example bellow the mediaSerializer is imported like that (from base_project.serializers import MediaSerializer) on the views.py file and is defined on serializers.py

go_to_def_1

go_to_def_2

Am I doing something wrong or is it a bug? Maybe some configuration I don't know about.
Thanks guys.

Environment data

  • VS Code version: 1.48.2
  • Python extension version: microsoft/vscode-python
  • OS and version: Linux Ubuntu 18.04
  • Python version (& distribution if applicable, e.g. Anaconda): 3.4
  • Value of the python.languageServer setting: jedi

Activity

  1. added
    triage-needed
    bug
    on Sep 2, 2020
  2. ghost removed
    triage-needed
    on Sep 2, 2020
  3. karthiknadig commented on Sep 2, 2020

    @karthiknadig
    Member

    Thanks for your feedback! We have recently released a new and more performant language server called Pylance which likely solves these issues you are reporting.  You can download Pylance from the marketplace and install it alongside the core Python extension. Because our team's development efforts have shifted to support the new language server, we'd encourage you to try it out. If you try out Pylance and this issue persists, you can open an issue on the pylance-release repo.

  4. added
    info-needed
    on Sep 2, 2020
  5. weberxw commented on Sep 2, 2020

    @weberxw
    Author

    Thanks for your feedback! We have recently released a new and more performant language server called Pylance which likely solves these issues you are reporting.  You can download Pylance from the marketplace and install it alongside the core Python extension. Because our team's development efforts have shifted to support the new language server, we'd encourage you to try it out. If you try out Pylance and this issue persists, you can open an issue on the pylance-release repo.

    Thanks for the reply !

    I already did the test with Pylance and actually I got worse results.
    When I select pylance as language server and try the same example above what happens is
    ctrl + click doesn't do anything
    f12 -> no definition found for "MediaSerializer"

  6. karthiknadig commented on Sep 2, 2020

    @karthiknadig
    Member

    I will file a bug on this is pylance.

    As for the jedi, we have to wait until we finish #11995 to be certain about where the issue is. I am assuming it is due to how we handle completions with our wrapper for jedi.

  7. karthiknadig commented on Sep 2, 2020

    @karthiknadig
    Member

    Closing this since we have to wait for #11995. We will look into this issue as a part of moving Jedi behind LSP.

  8. ghost removed on Sep 2, 2020
  9. karthiknadig commented on Sep 2, 2020

    @karthiknadig
    Member
  10. locked as resolved and limited conversation to collaborators on Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

buginfo-needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions