In my case it was: https://github.com/microsoft/vscode/issues/142564#issuecomment-1041004004
Also make sure you have not disabled the built-in typescript extension:
In the extensions view
Search @builtin typescript
Make sure TypeScript and JavaScript Language Features is enabled
Answer from pailhead on Stack OverflowIn my case it was: https://github.com/microsoft/vscode/issues/142564#issuecomment-1041004004
Also make sure you have not disabled the built-in typescript extension:
In the extensions view
Search @builtin typescript
Make sure TypeScript and JavaScript Language Features is enabled
I had the same issue today, some answers online pointed out that this is a problem with extensions, but each blame different one. What worked for me is reinstalling these extensions: python, c/c++, git history, then restarting VSCode. Maybe for your situation you need to uninstall different extensions and install them again, especially (but not limited to) recent ones.
I had the same problem and changing the python language server from Jedi to Microsoft or Pylance did fix the problem. To do this go to the settings with Cntrl + , and search for python.languageserver
When I used the code you provided and disabled the Python extension, I encountered the same problem as you.
Since "Go to Definition" is supported by the corresponding language service extension, it is recommended that you check that the current Python extension is available and confirm that the selected python interpreter is also available. In addition, please try to reload VSCode.
c++ - VSCode "go to definition" not working - Stack Overflow
Go to Definition missing from menu [Python]
VSCode no longer showing Go To Definition on right click.
Go to definition not working anymore
Does anyone know how to fix this? It's not a must, but it bothers me.
I had a the same issue: F12 and Ctrl + Click and Right Click "Go To Definition" wasn't working.
The fix for me was:
Can try uninstall then re-install Go extension first. If not work:
- Go to Extensions
- Click "Disable All Installed Extensions"
- Close and Reopen VS Code
- Back to Extensions and "Enable All Extensions"
Essentially enable/disable all extensions fixed the issue.
I recently came across this same issue and after trying all of the suggested solutions I could find with no success, I found this article:
https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc
Basically my project grew too large and VS code was no longer able to track all files, which messed up the "go to definition" functionality.
After following the steps on the link to increase the maximum number of files to be tracked, the issue was resolved.
The correction is pretty simple (tested on Ubuntu 18.04):
Add this line:
fs.inotify.max_user_watches=524288
to the end of the file /etc/sysctl.conf
After saving, run the following command:
sudo sysctl -p
Hopefully this will be useful to someone else, this has been bothering me for the last few days.
TL;DR: Your language server might not be opening up properly because vscode version is not up to date. This goes to all languages
If your symptoms include
- Type
>Python: Show outputin vscode console - Restart vscode and open any python file
- In the output if you see any line saying something close to
Error: cant't start language server because vscode version low
You need your vscode updated to latest version.
In my case even though i had Python extension i was missing Pylance extension, after manually installing it jump to definition is working as intended
I think this is a limitation in the way the Python extension for vscode is currently implemented. I reported the issue in their tracker on github:
https://github.com/DonJayamanne/pythonVSCode/issues/93
When hit F12, its shortcut for 'Go to definition'
- Make sure you have selected your Python Interpreter
ctrl + shift + p and then searching for Python: Select Interpreter
or you may also try
- Autocomplete using IntelliSense Extension https://code.visualstudio.com/docs/python/editing