简体   繁体   中英

How to see the source code inside the library when doing ctrl+click(go to definition) in vscode (python)

I know that in vscode, we can find the definition of variable/function by ctrl+clicking. Ctrl+click also supports that for variables/functions declared inside the libararies we've installed.(eg torch, numpy, ..)

In my vscode, the 'go to definition' in my own file is available, but I can't click variables defined in libraries.

I want variables/functions of libraries also searchable by ctrl+clicking. How do I make it also available?

If you install the libraries in your virtual environments, You should change the python interpreter to your virtualenv that you use from bottom right side of the vscode and then alt+click can help you.

This is a function provided by pylance.

You can install pylance extension.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM