vscode python go to symbol not working

2020-07-09 07:46发布

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.

2条回答
Melony?
2楼-- · 2020-07-09 08:19

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

查看更多
啃猪蹄的小仙女
3楼-- · 2020-07-09 08:19

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"
    ]
}
查看更多
登录 后发表回答