vscode python go to symbol not working

12,799

Solution 1

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

Solution 2

This is working for me, but only for local files. See screenshot below:

enter image description here

I am using portable 1.0.0 zip on windows 7. I installed Don Jayamanne's Python extension. Maybe you need it for it to work? Haven't tried without it.

In case you are unfamiliar with the extension, there are some configuration changes to make after you install it if python is not in your PATH.

You will have to tell it where your python lives using these config updates:

Configure the path to the python interpreter in the User Settings file (settings.json) as follows. Ensure to specify the fully qualified name of the python executable. "python.pythonPath":"c:/python27/python.exe"

I also updated the debugging setting too, not sure if that has any impact.

Simply provide the fully qualified path to the python executable in the "python" setting within the configuration settings in the launch.json file as follows:

{
    "name": "Python",
    "type": "python",
    "request": "launch",
    "stopOnEntry": true,
    "program": "${file}",
    "pythonPath": "c:/python27/python.exe",
    "debugOptions": [
        "WaitOnAbnormalExit",
        "WaitOnNormalExit",
        "RedirectOutput"
    ]
}
Share:
12,799
jramirez
Author by

jramirez

Was born and still alive.

Updated on July 20, 2022

Comments

  • jramirez
    jramirez almost 2 years

    I just downloaded vscode ver 1.0 and I really like it. However it looks like "go to symbol" is not working for python source files? I've tried installing different extensions, but I cannot seem to get that working. Is this not fully supported?

    I did try it with a node.js project folder and the go to symbol works perfectly there.

    Can somebody point me to docs? Maybe I could write my own my go to symbol plugin.

    Thanks for your time.

  • ogrisel
    ogrisel about 8 years
    Actually it works within a file but it does not work to go to a function or class definition located in another file of my project and even less to a file of a module installed in the site-packages folder matching the Python that I configured in pythonPath.
  • Igor
    Igor about 8 years
    I see the problem. Yeah, it is only showing local file for me too.