3

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.

3
  • Have you tried using the language service provided by the extension "Pylance"? When we hover the mouse over this code, "docstring" is displayed. Commented Feb 26, 2021 at 5:17
  • Right now, when I hover the mouse over the text in the main editor, the docstring displays, But somehow when in the debug console, when the mouse is over the text, nothing happens. Commented Feb 26, 2021 at 5:53
  • At present, the display of "docstring" in VS Code is in "Editor" (The main area to edit your files.), and it does not support displaying "docstring" in "DEBUG CONSOLE", it is used to display debugging results and code interaction of. Commented Feb 26, 2021 at 6:02

2 Answers 2

1

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.

enter image description here

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:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.