简体   繁体   English

折叠 python vs code 中的注释

[英]Collapse python comment in vs code

Not long ago, I started commenting a lot of code in python, the problem is that vs code does not offer me to reduce the comment.前不久开始在python给很多代码加注释,问题是vs code不给我减注释。

I have tried single line comments and group comments but same issue..我试过单行评论和群评论但同样的问题..

python single line comment python multiline program python 单行注释python 多行程序

In other languages for example C.. it offers me in the bar a button to collapse在其他语言中,例如 C.. 它在栏中为我提供了一个折叠按钮

example in C C 中的示例

How can comment collapsing be enabled in VS?如何在 VS 中启用评论折叠?

I tried it.我尝试过这个。 I think vscode itself provides this function, but I don't know why it doesn't work for you.我认为vscode本身提供了这个function,但我不知道为什么它对你不起作用。

As can be seen from the figure, multiline annotations can be folded.从图中可以看出,多行注释是可以折叠的。

在此处输入图像描述

在此处输入图像描述

Of course, there is no solution for your situation.当然,您的情况没有解决方案。 We can add #region before the content, add #endregion after it.我们可以在内容前加#region ,在内容后加#endregion

在此处输入图像描述

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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