You can hit Ctrl + K Ctrl + I. This will execute the editor.action.showHover command and will display the same text that is displayed when you hover over for example a function. Unfortunately there seems to be no corresponding editor.action.hideHover command (I searched the keybindings.json). But it should be possible to hide the text again by pressing the Esc key.
You can hit Ctrl + K Ctrl + I. This will execute the editor.action.showHover command and will display the same text that is displayed when you hover over for example a function. Unfortunately there seems to be no corresponding editor.action.hideHover command (I searched the keybindings.json). But it should be possible to hide the text again by pressing the Esc key.
I guess you want parameter suggestions for a method or function. Shortcut for mac is: cmd + Shift + Space.
See other question: Is there a "quick documentation" shortcut for VS code?
For all shortcuts press: cmd + k, cmd + r.
Shortcut to display function/method docstring
Is there a "quick documentation" shortcut for VS code? - Stack Overflow
Ubuntu 25.04, VSCode docstring keyboard shortcut?
visual studio code - Shortcut for getting a python function doc string in VSCode - Stack Overflow
Okay, so I swear I remember this was a feature when I was using VSCode at some point. Essentially, I either hover or use a special macro to view the parameters or docstring of a function in my code. But with my VSCode version 1.91.1 currently, it's almost like this functionality doesn't exist.
I have tried:
-
Hovering over the function definition with and without parentheses (both native and newly-defined functions)
-
cmd + k, cmd + r (both within and outside the parentheses)
-
cmd + shift + spacebar
-
Looking for an extension, but I don't think I should need to.
Any help would be appreciated. I'm using Python primarily.
AFAIK I know, there are three major docstring conventions beyond PEP 257:
-
reST style
-
Google style
-
NumPy style
I use Google style because I find it the simplest. I'm also using type hints throughout my code, which helps keep docstrings readable and concise.
Unfortunately, VS Code's tooltips provide no proper support for any of them. It tries to parse the entire docstring as Markdown, resulting in ugly or illegible tootltips. I recently disabled Jedi in favor of MS Language Server which made the problem worse. (Notes on this below)
I could ditch all docstring conventions and resort to writing Markdown, but it would mean giving up my documentation generation tools (sphinx, pydocmd). Has anyone managed to get docstring tooltips to look good on VS Code?
Sidetrack: Jedi vs MS Language Server?
Note: I disabled Jedi because it wanted to use rope for renaming variables. For some reason, VS Code fails to rename variables even when I install rope in my venv. In contrast, refactoring with MS Language Server just works...though it breaks tooltips even more.
So I am stuck in a dilemma between Jedi & MSLS:
-
Subpar tooltips & no refactoring support, or
-
Even worse tooltips & refactoring support
BTW, I'm using VS Code on Windows 10 with Git Bash as the default terminal. This setup allows me to use Linux commands provided by Git Bash, but has been causing some headaches...
Edit: I just checked again, and reStructuredText actually seems to produce somewhat usable docstrings. The caveat being that there is no way to document class attributes directly (Google style has the Attributes: section).


