VSCode: Show Python docstring of functions when in Debug Console
Question:
I am trying to see the docstring of functions when I am in debug console. But it turns out there is no way. Can someone suggest??
For example, if I hover the mouse over the following, nothing happens. Then if I type CTRL-K CTRL-I, nothing happens.
torch.gather
Then if I do:
help(torch.gather)
It says the evaluation is really slow and might be deadlocked.
I ended up googling for documentation, but that is very inefficient.
Answers:
At present, the "docstring" in VS Code is displayed in "Editor" (The main area to edit your files.), and it does not support displaying "docstring" in "DEBUG CONSOLE", "DEBUG CONSOLE" is used for code interaction And display the debugging results.
If you want to see the content of "docstring" in "DEBUG CONSOLE", please use the command "help(module)" as you mentioned during debugging, it will display the content of the module:
If I use help(torch.gather) in the vscode debug console, the vscode will crash and I can do nothing.
The better way is that use print(torch.gather.__doc__).
I hope help(torch.gather) can do the same thing in the future.
I am trying to see the docstring of functions when I am in debug console. But it turns out there is no way. Can someone suggest??
For example, if I hover the mouse over the following, nothing happens. Then if I type CTRL-K CTRL-I, nothing happens.
torch.gather
Then if I do:
help(torch.gather)
It says the evaluation is really slow and might be deadlocked.
I ended up googling for documentation, but that is very inefficient.
At present, the "docstring" in VS Code is displayed in "Editor" (The main area to edit your files.), and it does not support displaying "docstring" in "DEBUG CONSOLE", "DEBUG CONSOLE" is used for code interaction And display the debugging results.
If you want to see the content of "docstring" in "DEBUG CONSOLE", please use the command "help(module)" as you mentioned during debugging, it will display the content of the module:
If I use help(torch.gather) in the vscode debug console, the vscode will crash and I can do nothing.
The better way is that use print(torch.gather.__doc__).
I hope help(torch.gather) can do the same thing in the future.