简体   繁体   中英

Python bold multiline comments in VS Code

I am using multiline comments for my function like such:

def my_fn():
    """
    blah blah... source tags blah
    blah ...
    """
    ...

I am using VS Code and am referring to the comments displayed in the tooltip when hovering the mouse over a function.
I noticed that it picks up code format with tildes (`) but it doesn't show bold text when I use the double asterisks (*).
显示我的意思的屏幕截图

How can I bold/italicise some parts of my comment?

Not sure if it is a Python thing or a VS Code thing.

1.In VSCode, we can add the following styles for setting all comments in the file " settings.json ":

 "editor.tokenColorCustomizations": { "comments": { "fontStyle": "italic", // "bold" or "italic" or "underline" "foreground": "#aaaaaa", } }

在此处输入图像描述

在此处输入图像描述

2.For changing the style of part of the comment, you could search for related extensions in VSCode, they will provide different styles, for example: extension Better-Comments .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM