C Lu
C Lu

Reputation: 87

How to check for code sourcecode (parent) for python in vscode

I'm beginning to use vscode for python development. I'm a novice programmer in general, so I'm not sure what is the standard way of describing what I want: is a way , that things like pycharms provide, to check the source code of say, a class or a function, with one keyboard shortcut.

I've tried installing the Class IO extension, but doesn't seem to work.. I've tried the below keyboard shortcut specificationo in keybindings.json.

[{
"key": "shift+alt+g",
"command": "classio.goToParent",
"when": "editorLangId == 'python'"
},

Upvotes: 0

Views: 1462

Answers (2)

user5100770
user5100770

Reputation:

I think that you can consult the VS Code Keyboard Shortcuts (Windows) sheet at:

https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf

If you want to check the class definition (where you declared the class) your shortcut is F12. I hope this sheet can be useful enough for you to get started in VS Code.

Linux: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf

MacOS: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf

Upvotes: 0

gdef_
gdef_

Reputation: 1936

I think that what you want is the "Go to definition" functionality

If a language supports it, you can go to the definition of a symbol by pressing F12.

If you press Ctrl and hover over a symbol, a preview of the declaration will appear

Tip: You can jump to the definition with Ctrl+Click or open the definition to the side with Ctrl+Alt+Click.

Upvotes: 2

Related Questions