question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Go to definition not working anymore

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:16

github_iconTop GitHub Comments

1reaction
MatthewRustoncommented, 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

0reactions
kaushallcommented, May 28, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode "go to definition" not working - Stack Overflow
A simple solution that worked for me is that I closed the current workspace and created a new workspace, added the folders which...
Read more >
Ctrl + Click go to definition not working. : r/vscode - Reddit
I had a the same issue: F12 and Ctrl + Click and Right Click "Go To Definition" wasn't working. The fix for me...
Read more >
Go to definition not always working in VS Code
1 Answer 1 · "Refresh SObject Definitions" just silently fails for me - the UI says it's still running but it doesn't seem...
Read more >
nRF Connect Example Function "Go to Definition" returns "No ...
I build a C project with multiple files in VS Code and this feature works well. It looks like a SDK searching path...
Read more >
vscode go to reference not working
Go To Definition causes your context (that is, the active code window, current line, ... If your Tab key is not working anymore,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found