In PHPSTORM when I type .classname or #id and hit TAB I got

<div class="classname"></div>

BUT I want it to be:

<div class="classname"></div><!-- .classname -->
有帮助吗?

解决方案

In original Emmet you can use |c filter to produce automatic comments: http://docs.emmet.io/filters/#comment-tags-c

But I don‘t know if this feature is supported by PhpStorm since it uses its own Emmet implementation.

其他提示

You can also go to Settings|Emmet|Filters enabled by default: Comment tags=true, if you dont want to type |c each time.

As Lewis mentioned, there's a preference that can be set for this. In PhpStorm 2017.3 it can be found under Settings > Editor > Emmet > HTML > Filters enabled by default. See screnshot below. enter image description here

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top