如何在 VS Code 中自定义注释字符? [英] How do I customize comment characters in VS Code?
问题描述
VS Code 似乎不理解在评论规则方面应该将 less 文件视为 css 文件.我怎么能告诉它对 css 和 less 文件的处理相同?
VS Code does not appear to understand that a less file should be treated as a css file when it comes to comment rules. How can I tell it to treat a css and a less file the same?
推荐答案
VSCode 在这种情况下运行正常./* ... */
和 //...
都是 LESS 中的有效注释,但是它们在生成的 CSS 中确实略有不同:
VSCode is behaving correctly in this case. Both /* ... */
and // ...
are valid comments in LESS, they do however differ slightly in the generated CSS:
/* ... */
将编译为/* ... */
//...
将在编译期间被移除
/* ... */
will compile to/* ... */
// ...
will be removed during compilation
这允许删除注释,从而避免传输到客户端的额外字节.出于这个原因,LESS 开发人员通常使用双斜杠样式的注释.
This allows comments to be removed, saving extra bytes from being transferred to the client. The double-slash style comment is typically what LESS developers use for that reason.
这篇关于如何在 VS Code 中自定义注释字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!