Reputation: 311
I saw on youtube video that vs code shows what the function does when you hover over. For example,
but when I do this it shows the parameter documentation only. How do I achieve this in my vs code?
Upvotes: 6
Views: 3737
Reputation: 145
This is called a docstring. You can check the docs here.
To get it shown you must have the Python official extension installed in your VSCode and the comment in the implementation of the method.
Here is an example:
def func():
""" my docs"""
You must install this extension:
Name: Python Id: ms-python.python Description: Linting, Debugging (multi-threaded, remote), Intellisense, Jupyter Notebooks, code formatting, refactoring, unit tests, and more. Version: 2021.2.633441544 Publisher: Microsoft VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.python
Upvotes: 2