Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Go to definition not working anymore #1064

@DonJayamanne

Description

@DonJayamanne

@kaushall commented on Mon Apr 22 2019

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.


@xavieralt commented on Wed Apr 24 2019

Hi,

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


@xavieralt commented on Wed Apr 24 2019

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


@DonJayamanne commented on Wed Apr 24 2019

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


@kaushall commented on Wed Apr 24 2019

@DonJayamanne @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


@MatthewRuston commented on Thu Apr 25 2019

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


@kaushall commented on Mon Apr 29 2019

@DonJayamanne @ericsnowcurrently Any update or ETA for this issue?


@monobot commented on Tue May 07 2019

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


@MatthewRuston commented on Fri May 10 2019

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


@DonJayamanne commented on Fri May 10 2019

@MatthewRuston @monobot @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).

@DonJayamanne commented on Fri May 10 2019

@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.


@MatthewRuston commented on Fri May 10 2019

@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

@monobot commented on Fri May 10 2019

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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions