Skip to content

Go to definition not working anymore #5425

Closed

Description

Environment data

  • VS Code version: 1.33.1 (Stable Channel)
  • Extension version (ms-python.python): 2019.3.6558
  • OS and version: Ubuntu 18.04
  • Python version (& distribution if applicable, e.g. Anaconda): 2.7.15
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): virtualenv
  • Relevant/affected Python packages and their versions: None

Expected behaviour

Visual Studio Code navigate to the definition of the function which resides inside the workspace (Working fine earlier)

Actual behaviour

Popup with Message: "No definition found for 'function_name' "

Steps to reproduce:

  1. import the class from another python file
  2. declare and initialize the class
  3. implement any method of the class
  4. after that right click on method and choose go to definition

For example:
from commonlib.helpers.general_helper import Helper
helper = Helper()
user_data = helper.get_user_profile(user_id)

Logs

No logs or errors in console

Things to note

But if you hover the implementation then it will show you the class with function name and all the parameters of the functions that are requested in definition of the function. It's also suggesting the function while implementing. So maybe there is some issue with only "Go to Definition".

Also one more thing if you've written function in same class and use self.method_name() then it will able to navigate to the method

Things I've tried

  • Tried to reinstall the python extension (ms-python.python) >> Not worked
  • Tried to install earlier versions of the python extension (ms-python.python) >> Not worked
  • Closing all the files and reopening of the workspace >> Not worked
  • Opening the definition file in new tab and tried "Go to definition" >> Not worked
  • Tried to downgrade VS Code to earlier versions 1.32 and 1.31 >> Not worked
  • Tried to disable all other extensions except python (ms-python.python) >> Not worked

Please if possible provide an urgent upstream-fix or any temporary fix to resolve this issue.

Activity

  1. ghost added
    triage-neededNeeds assignment to the proper sub-team
    on Apr 23, 2019
  2. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Apr 23, 2019
  3. xavieralt commented on Apr 24, 2019

    @xavieralt

    Hi,

    Just got the same issue after automatic upgrade to new release 2019.4.11881, downgrading extension to 2019.3.6558 solve the issue.

  4. xavieralt commented on Apr 24, 2019

    @xavieralt

    Seems to be fixed by #5437, manually applying it solve the issue with latest release.

  5. DonJayamanne commented on Apr 24, 2019

    @DonJayamanne

    This has been resolved in the latest update, please update your extension.
    Duplicate of #5437

  6. ghost removed on Apr 24, 2019
  7. kaushall commented on Apr 25, 2019

    @kaushall
    Author

    Don Jayamanne (@DonJayamanne) Eric Snow (@ericsnowcurrently) As per your instruction I've updated the extension to the latest version (2019.4.11987) but the issue is still there and not resolved. I'm still getting popup with message No definition found for 'function_name'

    VS Code version: 1.33.1 (Stable Channel)
    Extension Version (ms-python.python): 2019.4.11987
    OS and version: Ubuntu 18.04
    Python version (& distribution if applicable, e.g. Anaconda): 2.7.15
    Type of virtual environment used (N/A | venv | virtualenv | conda | ...): virtualenv

  8. MatthewRuston commented on Apr 25, 2019

    @MatthewRuston

    I can also reproduce this using a base case as outlined in the attached screenshot. "Go to Definition" on the get_name() method no longer works.

    image

    VS Code:1.33.1
    Python Extension:2019.4.11987
    Visual Studio IntelliCode - Preview: 1.1.5
    OS: mac OS 10.14.2
    virtual environment: conda

  9. ghost added
    triage-neededNeeds assignment to the proper sub-team
    on Apr 25, 2019
  10. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Apr 25, 2019
  11. kaushall commented on Apr 29, 2019

    @kaushall
    Author
  12. monobot commented on May 7, 2019

    @monobot

    Its been working terrible from last update, way worse than sublime.
    looking forward for an update, thanks for your work!

  13. MatthewRuston commented on May 10, 2019

    @MatthewRuston

    Any update on this? Would additional code samples and test cases help get this fixed?

  14. DonJayamanne commented on May 10, 2019

    @DonJayamanne

    Matthew Ruston - WellSky (@MatthewRuston) Héctor Alvarez (@monobot) Kaushal Vora (@kaushall)

    Hi everyone, are you using the language server?

    • Close and Open VS Code
    • Open a python file
    • Open the Python output panel or select the command Python: Show Output
    • Please let me know whether you see Starting Microsoft Python language server. in the output (towards the very top).
  15. DonJayamanne commented on May 10, 2019

    @DonJayamanne

    Héctor Alvarez (@monobot)

    Its been working terrible from last update, way worse than sublime.

    Please could you provide more information. What's worse, what are the errors.
    We need more information to be able to help you.

  16. MatthewRuston commented on May 10, 2019

    @MatthewRuston

    Don Jayamanne (@DonJayamanne) definitely running the Python Language Server

    Starting Microsoft Python language server.
    [Info  - 3:22:10 PM] GetCurrentSearchPaths /Users/mruston/miniconda3/bin/python 
    [Info  - 3:22:10 PM] Python search paths:
    [Info  - 3:22:10 PM]     /private/var/folders/0r/shfdkt9n2sj9xxtg9wckk11r0000gp/T/nkfwqccg.lk5
    [Info  - 3:22:10 PM]     /Users/mruston/miniconda3/lib/python3.7
    [Info  - 3:22:10 PM]     /Users/mruston/miniconda3/lib/python3.7/lib-dynload
    [Info  - 3:22:10 PM]     /Users/mruston/miniconda3/lib/python3.7/site-packages
    [Info  - 3:22:10 PM] Configuration search paths:
    [Info  - 3:22:11 PM] Microsoft Python Language Server version 0.2.66.0
    [Info  - 3:22:11 PM] Initializing for /Users/mruston/miniconda3/bin/python
    
  17. monobot commented on May 10, 2019

    @monobot

    Hello Don.
    Sorry for my previous terrible feedback, its a frustration message.
    Please find your request bellow:

    Downloading https://pvsc.azureedge.net/python-language-server-stable/Python-Language-Server-linux-x64.0.2.74.nupkg... complete
    Unpacking archive... done
    [Info  - 21:26:51] GetCurrentSearchPaths /home/monobot/.envs/sanic_example-N8OtGXpg/bin/python 
    [Info  - 21:26:51] Python search paths:
    [Info  - 21:26:51]     /home/monobot/.envs/sanic_example-N8OtGXpg/lib/python3.6
    [Info  - 21:26:51]     /home/monobot/.envs/sanic_example-N8OtGXpg/lib/python3.6/lib-dynload
    [Info  - 21:26:51]     /usr/lib/python3.6
    [Info  - 21:26:51]     /home/monobot/.envs/sanic_example-N8OtGXpg/lib/python3.6/site-packages
    [Info  - 21:26:51] Configuration search paths:
    [Info  - 21:26:51] Microsoft Python Language Server version 0.2.74.0
    [Info  - 21:26:51] Initializing for /home/monobot/.envs/sanic_example-N8OtGXpg/bin/python
    

    The problems are:
    When goto definition from a class, first goes to the import and then if you click again goes to the real class definition.
    But that only happens sometimes, its not reliable, sometimes I have to delete the tags file in vscode so it reindex.
    Before the problem started if you click on the method bellow it directed you to the method definition of the class Helllo:

    hello = Hello()
    hello.method('something')
    

    Now it doesnt work any more.

    If anything else i can help you with, please make me know.

    Thanks again for your work.

  18. DonJayamanne commented on May 10, 2019

    @DonJayamanne
  19. ghost removed on May 10, 2019
  20. DonJayamanne commented on May 10, 2019

    @DonJayamanne

    Héctor Alvarez (@monobot)

    Sorry for my previous terrible feedback, its a frustration message.

    Absolutely no problem, I can understand how this would impact your work.
    Apologies for the inconvenience caused. I can assure you, we have a whole team working just on the language server (the component that provides intellisense, go to definition, etc). However sometimes it can take a while to get fixes out as the causes might not be immediately evident.
    Thanks for being patient.

    Please note, we've moved the issue to another repo where a separate team can help resolve those issues.

  21. BeyondEvil commented on May 28, 2019

    @BeyondEvil

    Matthew Ruston - WellSky (@MatthewRuston) Héctor Alvarez (@monobot) Kaushal Vora (@kaushall)

    Hi everyone, are you using the language server?

    * Close and Open VS Code
    
    * Open a python file
    
    * Open the `Python` output panel or select the command `Python: Show Output`
    
    * Please let me know whether you see `Starting Microsoft Python language server.` in the output (towards the very top).
    

    I have this issue as well, sort of, Go to Definition works for installed packages but not for my local files/workspace.

    Follwing the above steps my output is:

    Starting Jedi Python language engine.
    ##########Linting Output - flake8##########

    macOS 10.14.4
    VSS 1.34.0
    Python 2019.4.12954
    python 3.7.3

  22. kaushall commented on May 28, 2019

    @kaushall
    Author

    Jim Brännlund (@BeyondEvil) This issue has been resolved already.

    I think jedi should be disabled.

    try to add following line in settings.json >> restart the vscode >> open python file >> check again,

    "python.jediEnabled": false,

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions