add-keyword
Add a new highlight keyword to todo-highlight end-to-end
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add a new highlight keyword to todo-highlight end-to-end
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | add-keyword |
| description | Add a new highlight keyword to todo-highlight end-to-end |
Add the keyword: $ARGUMENTS
Complete all steps below in order. Do not skip any — each touches a different file and missing one leaves the keyword partially wired.
File: lsp/src/keywords.rs, function build_keywords().
Add a new entry to the definitions array:
("KEYWORD", "keyword"),
Convention: the second element is the semantic token modifier — the keyword in lowercase (e.g. IDEA → "idea"). All keywords share the standard keyword token type; the modifier bit and legend entry are derived automatically from the array index.
File: lsp/src/main.rs, test test_all_keywords.
Add the new keyword to the test string and increment the expected count:
let text = "TODO FIXME HACK NOTE INFO WARN WARNING BUG XXX DEPRECATED KEYWORD";
let tokens = scan_tokens(text, &kws);
assert_eq!(tokens.len(), 11); // was 10
The per-token modifier-bit loop needs no change — bits are derived from definition order, which matches the text above.
File: README.md.
{ "token_type": "keyword", "token_modifiers": ["keyword-lowercase"], "foreground_color": "#RRGGBB", "font_weight": "bold" }
Pick a color that doesn't clash with the existing set. Current palette:
#FF8C00 — TODO#FF2D55 — FIXME#FFD60A — HACK#0A84FF — NOTE, INFO#FF9F0A — WARN, WARNING#FF453A — BUG#BF5AF2 — XXX#98989D — DEPRECATED./check.sh
All previous steps must be done before running this. If any test fails, fix it before continuing.