Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see the source code inside the library when doing ctrl+click (go to definition) in VS Code (Python)

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

In my VS Code, 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?

like image 558
WOOJUNG SON Avatar asked Apr 27 '26 01:04

WOOJUNG SON


1 Answers

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.

like image 122
Ali Esmaeili Avatar answered Apr 29 '26 14:04

Ali Esmaeili



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!