在PhpStorm中隐藏评论

在PhpStorm中隐藏评论

问题描述:

I know that it is possible in PhpStorm to remove comments like these with the plus and minus signs on the left:

/*
This is
a comment
*/

But at the moment, I have some code with these single line comments in it.

//Some text explaining the code beneath it
$foo = bar;

//Another piece of text explaining some code
$bar = foo;

Is there a shortcut in PhpStorm to hide the single line comments (the ones that are created with "//")? When you have a few of these, it's not really bothering me, but when there are more comments than code, it gets a little bit annoying.

Thanks in advance.

我知道在PhpStorm中可以使用左侧的加号和减号删除这些注释:

  / * 
这是
a comment 
 * / 
  code>  pre> 
 
 

但此刻,我有一些 代码中包含这些单行注释。 p>

  //一些文本解释它下面的代码
 $ foo = bar; 
 
 // //另一段文字解释 一些代码
 $ bar = foo; 
  code>  pre> 
 
 

PhpStorm中是否有一个快捷方式来隐藏单行注释(用“//”创建的注释) ? 当你有一些这些时,它并没有真正困扰我,但当有更多的评论而不是代码时,它会有点烦人。 p>

提前致谢。 p> \ n div>

Please vote for IDEA-117927

Workarounds:

1.use custom folding regions, like:

//region Some text explaining the code beneath it 
//some more text 
//endregion 
$foo = bar;

2.change comments color to make them invisible (https://youtrack.jetbrains.com/issue/IDEA-106542#comment=27-497674)