|
1 | 1 | # Tutorial
|
2 | 2 |
|
3 | 3 | I needed a way to list [codetags](https://www.python.org/dev/peps/pep-0350/) in
|
4 |
| -my project. While Codetags extension helps standardizing the creation of code |
5 |
| -tags you can use the extensions below to add more value to it. |
| 4 | +my project. While |
| 5 | +[vscode-codetags](https://marketplace.visualstudio.com/items?itemName=cg-cnu.vscode-codetags) |
| 6 | +lets you standardizing the creation of tags you can use the extensions below to |
| 7 | +add more value to it. This guide initially written by [Théry |
| 8 | +Fouchter](https://github.com/TheryFouchter) helps you setup and list codetags |
| 9 | +with Icons and color per codetag. |
6 | 10 |
|
7 | 11 | ## Screenshot
|
8 | 12 |
|
9 | 13 | 
|
10 | 14 |
|
11 |
| -## Todo Tree |
| 15 | +## Extensions |
| 16 | + |
| 17 | +You can use the below addons and its settings to create a set of custom todos |
| 18 | +and display them in the Todo Tree and assign specific color using better |
| 19 | +comments. Add the below configurations to settings.json |
| 20 | + |
| 21 | +### Code Tags |
| 22 | + |
| 23 | +You can extend tags in Code Tags by |
| 24 | + |
| 25 | +```json |
| 26 | +// Add additional codetags |
| 27 | +"codetags.custom": [ |
| 28 | + { |
| 29 | + "name": "Caveats", |
| 30 | + "description": "Implementation details/gotchas" |
| 31 | + }, |
| 32 | + { |
| 33 | + "name": "See", |
| 34 | + "description": "Pointers to other code, web link, ect." |
| 35 | + }, |
| 36 | + { |
| 37 | + "name": "NoBug", |
| 38 | + "description": "Will Not Be Fixed" |
| 39 | + }, |
| 40 | + { |
| 41 | + "name": "REQ", |
| 42 | + "description": "Satisfactions of specific, formal requirements" |
| 43 | + }, |
| 44 | + { |
| 45 | + "name": "RFE", |
| 46 | + "description": "Requests For Enhancement" |
| 47 | + }, |
| 48 | + { |
| 49 | + "name": "!!!", |
| 50 | + "description": "In need of immediate attention" |
| 51 | + }, |
| 52 | + { |
| 53 | + "name": "ToDoc", |
| 54 | + "description": "Needs Documentation" |
| 55 | + }, |
| 56 | + { |
| 57 | + "name": "Cred", |
| 58 | + "description": "Credits" |
| 59 | + } |
| 60 | +] |
| 61 | +``` |
| 62 | + |
| 63 | +### Todo Tree |
12 | 64 |
|
13 | 65 | [Todo
|
14 | 66 | Tree](https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.todo-tree)
|
15 | 67 | by [Gruntfuggly](https://marketplace.visualstudio.com/publishers/Gruntfuggly)
|
16 | 68 | lets you display all the TODOs in your project. Its an amazing addon and it can
|
17 | 69 | be extended to track codetags.
|
18 | 70 |
|
19 |
| -## Better Comments |
| 71 | +```json |
| 72 | +// (recommended) only highlight the tag due to the regex bellow |
| 73 | +"todo-tree.highlights.defaultHighlight": { |
| 74 | + "type": "tag" |
| 75 | +}, |
| 76 | +// (optional) special regex to filter some special cases not handled by todo tree |
| 77 | +"todo-tree.regex.regex": "((//|#|<!--|;|/\\*|\\*|^)\\s*($TAGS)(:+|[ \\t]+|[\\r\\n]))", |
| 78 | +// Your codetags |
| 79 | +"todo-tree.general.tags": [ |
| 80 | + "TODO", |
| 81 | + "FIXME", |
| 82 | + "BUG", |
| 83 | + "IDEA", |
| 84 | + "WTF", |
| 85 | + "HACK", |
| 86 | + "NOTE", |
| 87 | + "CAVEATS", |
| 88 | + "SEE", |
| 89 | + "NOBUG", |
| 90 | + "REQ", |
| 91 | + "RFE", |
| 92 | + "!!!", |
| 93 | + "TODOC", |
| 94 | + "CRED" |
| 95 | +], |
| 96 | +// The color of your codetags |
| 97 | +"todo-tree.highlights.customHighlight": { |
| 98 | + "TODO": { |
| 99 | + "foreground": "#FF8C00", |
| 100 | + "icon": "check" |
| 101 | + }, |
| 102 | + "FIXME": { |
| 103 | + "foreground": "#FF8C00", |
| 104 | + "icon": "alert" |
| 105 | + }, |
| 106 | + "BUG": { |
| 107 | + "foreground": "#FF2D00", |
| 108 | + "icon": "bug" |
| 109 | + }, |
| 110 | + "IDEA": { |
| 111 | + "foreground": "#98C379", |
| 112 | + "icon": "light-bulb" |
| 113 | + }, |
| 114 | + "WTF": { |
| 115 | + "foreground": "#FF2D00", |
| 116 | + "icon": "stop" |
| 117 | + }, |
| 118 | + "HACK": { |
| 119 | + "foreground": "#3498DB", |
| 120 | + "icon": "hubot" |
| 121 | + }, |
| 122 | + "NOTE": { |
| 123 | + "foreground": "#98C379", |
| 124 | + "icon": "note" |
| 125 | + }, |
| 126 | + "CAVEATS": { |
| 127 | + "foreground": "#98C379", |
| 128 | + "icon": "issue-opened" |
| 129 | + }, |
| 130 | + "SEE": { |
| 131 | + "foreground": "#895FAA", |
| 132 | + "icon": "eye" |
| 133 | + }, |
| 134 | + "NOBUG": { |
| 135 | + "foreground": "#3498DB", |
| 136 | + "icon": "issue-closed" |
| 137 | + }, |
| 138 | + "REQ": { |
| 139 | + "foreground": "#895FAA", |
| 140 | + "icon": "checklist" |
| 141 | + }, |
| 142 | + "RFE": { |
| 143 | + "foreground": "#FF8C00", |
| 144 | + "icon": "request-changes" |
| 145 | + }, |
| 146 | + "!!!": { |
| 147 | + "foreground": "#FF2D00", |
| 148 | + "icon": "alert" |
| 149 | + }, |
| 150 | + "TODOC": { |
| 151 | + "foreground": "#FF8C00", |
| 152 | + "icon": "pencil" |
| 153 | + }, |
| 154 | + "CRED": { |
| 155 | + "foreground": "#895FAA", |
| 156 | + "icon": "person" |
| 157 | + } |
| 158 | +} |
| 159 | +``` |
| 160 | + |
| 161 | +### Better Comments |
20 | 162 |
|
21 | 163 | [Better
|
22 | 164 | Comments](https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments)
|
23 | 165 | by [Aaron Bond](https://marketplace.visualstudio.com/publishers/aaron-bond)
|
24 | 166 | makes your comments beautify. You can configure it to work with codetags.
|
| 167 | + |
| 168 | +```json |
| 169 | +// The color of the line of your codetags |
| 170 | +"better-comments.tags": [ |
| 171 | + { |
| 172 | + "tag": "!", |
| 173 | + "color": "#FF2D00", |
| 174 | + "strikethrough": false, |
| 175 | + "backgroundColor": "transparent" |
| 176 | + }, |
| 177 | + { |
| 178 | + "tag": "?", |
| 179 | + "color": "#3498DB", |
| 180 | + "strikethrough": false, |
| 181 | + "backgroundColor": "transparent" |
| 182 | + }, |
| 183 | + { |
| 184 | + "tag": "//", |
| 185 | + "color": "#474747", |
| 186 | + "strikethrough": true, |
| 187 | + "backgroundColor": "transparent" |
| 188 | + }, |
| 189 | + { |
| 190 | + "tag": "todo", |
| 191 | + "color": "#FF8C00", |
| 192 | + "strikethrough": false, |
| 193 | + "backgroundColor": "transparent" |
| 194 | + }, |
| 195 | + { |
| 196 | + "tag": "*", |
| 197 | + "color": "#98C379", |
| 198 | + "strikethrough": false, |
| 199 | + "backgroundColor": "transparent" |
| 200 | + }, |
| 201 | + { |
| 202 | + "tag": "FIXME", |
| 203 | + "color": "#FF8C00", |
| 204 | + "strikethrough": false, |
| 205 | + "backgroundColor": "transparent" |
| 206 | + }, |
| 207 | + { |
| 208 | + "tag": "BUG", |
| 209 | + "color": "#FF2D00", |
| 210 | + "strikethrough": false, |
| 211 | + "backgroundColor": "transparent" |
| 212 | + }, |
| 213 | + { |
| 214 | + "tag": "IDEA", |
| 215 | + "color": "#98C379", |
| 216 | + "strikethrough": false, |
| 217 | + "backgroundColor": "transparent" |
| 218 | + }, |
| 219 | + { |
| 220 | + "tag": "WTF", |
| 221 | + "color": "#FF2D00", |
| 222 | + "strikethrough": false, |
| 223 | + "backgroundColor": "transparent" |
| 224 | + }, |
| 225 | + { |
| 226 | + "tag": "HACK", |
| 227 | + "color": "#3498DB", |
| 228 | + "strikethrough": false, |
| 229 | + "backgroundColor": "transparent" |
| 230 | + }, |
| 231 | + { |
| 232 | + "tag": "NOTE", |
| 233 | + "color": "#98C379", |
| 234 | + "strikethrough": false, |
| 235 | + "backgroundColor": "transparent" |
| 236 | + }, |
| 237 | + { |
| 238 | + "tag": "CAVEATS", |
| 239 | + "color": "#98C379", |
| 240 | + "strikethrough": false, |
| 241 | + "backgroundColor": "transparent" |
| 242 | + }, |
| 243 | + { |
| 244 | + "tag": "SEE", |
| 245 | + "color": "#895FAA", |
| 246 | + "strikethrough": false, |
| 247 | + "backgroundColor": "transparent" |
| 248 | + }, |
| 249 | + { |
| 250 | + "tag": "NOBUG", |
| 251 | + "color": "#3498DB", |
| 252 | + "strikethrough": false, |
| 253 | + "backgroundColor": "transparent" |
| 254 | + }, |
| 255 | + { |
| 256 | + "tag": "REQ", |
| 257 | + "color": "#895FAA", |
| 258 | + "strikethrough": false, |
| 259 | + "backgroundColor": "transparent" |
| 260 | + }, |
| 261 | + { |
| 262 | + "tag": "RFE", |
| 263 | + "color": "#FF8C00", |
| 264 | + "strikethrough": false, |
| 265 | + "backgroundColor": "transparent" |
| 266 | + }, |
| 267 | + { |
| 268 | + "tag": "!!!", |
| 269 | + "color": "#FF2D00", |
| 270 | + "strikethrough": false, |
| 271 | + "backgroundColor": "transparent" |
| 272 | + }, |
| 273 | + { |
| 274 | + "tag": "TODOC", |
| 275 | + "color": "#FF8C00", |
| 276 | + "strikethrough": false, |
| 277 | + "backgroundColor": "transparent" |
| 278 | + }, |
| 279 | + { |
| 280 | + "tag": "CRED", |
| 281 | + "color": "#895FAA", |
| 282 | + "strikethrough": false, |
| 283 | + "backgroundColor": "transparent" |
| 284 | + } |
| 285 | +] |
| 286 | +``` |
0 commit comments