简体   繁体   English

如何在PhpStorm中更改评论类型

[英]How to change comment type in PhpStorm

Currently in my css files using the keyboard shortcut for a comment it will apply a comment with // . 当前在我的css文件中,使用键盘快捷键进行注释,它将使用//进行注释。

However I would like to use a comment style like so /* comment */ 但是我想使用像这样的注释样式/* comment */

Are you able to change this in PhpStorm/WebStorm? 您可以在PhpStorm / WebStorm中更改此设置吗?

// is not valid as comment symbols in plain *.css files -- IDE uses correct /* */ style here. //在纯*.css文件中作为注释符号无效*.css在此处使用正确的/* */样式。

If IDE actually uses that for comments in *.css files then check what CSS Dialect is set in Settings/Preferences | Languages & Frameworks | Stylesheets | Dialects 如果IDE实际使用*.css文件中的注释,请检查在Settings/Preferences | Languages & Frameworks | Stylesheets | Dialects设置”中Settings/Preferences | Languages & Frameworks | Stylesheets | Dialects什么CSS方言Settings/Preferences | Languages & Frameworks | Stylesheets | Dialects Settings/Preferences | Languages & Frameworks | Stylesheets | Dialects Settings/Preferences | Languages & Frameworks | Stylesheets | Dialects -- sounds like it's set to PostCSS (where // is valid). Settings/Preferences | Languages & Frameworks | Stylesheets | Dialects -听起来像是设置为PostCSS//是有效的)。

Another possibility -- *.css files are associated with some another File Type (eg already mentioned earlier PostCSS or perhaps Less/Sass). 另一种可能性- *.css文件与其他文件类型相关联(例如,前面已经提到过的PostCSS或Less / Sass)。


In any case: You may force /* */ for comments even for PostCSS -- use Block Comment shortcut instead of just Comment . 在任何情况下:即使对于PostCSS,您也可以强制/* */来进行注释-使用Block Comment快捷方式,而不仅仅是Comment You will have to make a selection first though... 不过,您必须先进行选择...

Code | Comment with Block Comment Code | Comment with Block Comment -- Ctrl + Shift + / using most keymaps. Code | Comment with Block Comment -Ctrl + Shift + /使用大多数键盘映射。

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

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