9ganzi
9ganzi

Reputation: 311

How to show what the function does in documentation popup in vs code?

I saw on youtube video that vs code shows what the function does when you hover over. For example,

enter image description here

but when I do this it shows the parameter documentation only. How do I achieve this in my vs code?

Upvotes: 6

Views: 3737

Answers (1)

math-s
math-s

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

Related Questions