做出特定风格的评论

Make specific Style of comments

在VScode中是否有一个快捷方式可以像这样制作comment/header

/*------------------------------------------------------------

site-header

------------------------------------------------------------*/

我该怎么做? 如果我需要某种扩展,请告诉我。

使用 custom snippet for this. Then you can setup a keybinding for the snippet.

下面是此类代码段的键绑定示例:

{
  "key": "cmd+k 1",
  "command": "editor.action.insertSnippet",
  "when": "editorTextFocus",
  "args": {
    "snippet": "/*------------------------------------------------------------\n${TM_FILENAME}\n------------------------------------------------------------*/"
  }
}

如果您希望 header 始终插入文件的顶部,您需要 create a simple extension

另一种更好的方法,实际上与我所问的不同,但有点酷。 有一个名为 "Better Comments" 的 VSCode 扩展,它允许您使用颜色代码添加评论。 Link For the same extension

Sample Screenshot for the same