VS Code 扩展“Todo Tree”如何简化您的编码 | Todo Tree 配置 | 在 VS Code 中高亮显示注释
使用 Todo Tree VS Code 扩展突出显示注释
Todo Tree扩展程序可以快速搜索您的工作区,查找TODO和FIXME等注释标签,并将其显示在活动栏的树形视图中。您可以将该视图从活动栏拖放到资源管理器窗格(或您希望的任何位置)。
📌 因此,让我们首先从扩展中下载并启用它。
现在已下载并具有默认配置。但让我们创建自定义规则集。
📌 前往VS Code 中的“管理”选项
📌现在点击设置
设置文件打开。
📌现在我们必须打开settings.json
文件。点击右上角的按钮。
📌现在您可以将下面的代码粘贴到那里并在其中进行自定义更改!
{
"todo-tree.highlights.defaultHighlight": {
"icon": "alert",
"type": "text-and-comment",
"foreground": "black",
"background": "white",
"opacity": 50,
"iconColour": "blue",
"gutterIcon": true
},
"todo-tree.highlights.customHighlight": {
"TODO": {
"icon": "checkbox",
"foreground": "black",
"background": "yellow",
"iconColour": "yellow"
},
"NOTE": {
"icon": "note",
"foreground": "white",
"background": "cornflowerblue",
"iconColour": "cornflowerblue"
},
"USEFUL": {
"icon": "verified",
"foreground": "black",
"background": "mediumaquamarine",
"iconColour": "mediumaquamarine"
},
"COMMENT": {
"icon": "comment",
"foreground": "white",
"background": "gray",
"iconColour": "white"
},
"LEARN": {
"icon": "bookmark",
"foreground": "white",
"background": "hotpink",
"iconColour": "hotpink"
},
"FIXME": {
"icon": "tools",
"foreground": "crimson",
"background": "burlywood",
"iconColour": "burlywood"
},
"RECHECK": {
"icon": "codescan",
"foreground": "white",
"background": "chocolate",
"iconColour": "chocolate"
},
"INCOMPLETE": {
"icon": "alert",
"foreground": "white",
"background": "mediumvioletred",
"iconColour": "mediumvioletred"
},
"BUG": {
"icon": "bug",
"foreground": "white",
"background": "crimson",
"iconColour": "crimson"
},
"SEE NOTES": {
"icon": "note",
"foreground": "white",
"background": "teal",
"iconColour": "teal"
},
"POST": {
"icon": "share",
"foreground": "white",
"background": "green",
"iconColour": "green"
},
"[ ]": {
"icon": "check",
"foreground": "black",
"background": "white",
"iconColour": "yellow"
},
"[x]": {
"icon": "check",
"foreground": "white",
"background": "green",
"iconColour": "green"
}
},
"todo-tree.general.tags": [
"BUG",
"SEE NOTES",
"HACK",
"FIXME",
"RECHECK",
"INCOMPLETE",
"TODO",
"NOTE",
"POST",
"USEFUL",
"LEARN",
"COMMENT",
"[ ]",
"[x]"
],
"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|^|^\\s*(-|\\d+.))\\s*($TAGS).*(\\n\\s*//\\s{2,}.*)*"
}
📌 每条评论都以对象的形式存在于此json
文件中。对象的结构如下:
📌 您可以基于此结构添加更多对象,并在其中包含对象名称-
编辑配置之前需要了解的一些事项
icon
- 用于在树视图中设置不同的图标。必须是有效的八角形图标。
iconColour
- 用于设置树中图标的颜色。如果未指定,则将尝试使用前景色或背景色。gutterIcon
- 设置为 true 以在编辑器边缘显示图标。Foreground
并且background-color
可以使用 HTML/CSS 颜色名称(例如"Salmon"
)、RGB 十六进制值(例如"#80FF00"
)、RGB CSS 样式值(例如"rgb(255,128,0)"
)来指定fontWeight
、、- 可用于通过标准 CSS 值来设置突出显示的样式fontStyle
。textDecoration
我们是-
分享💚给可能受益的人
❤️ 祝你编程愉快!
关注更多!