🧭 Code TODO
A simple and efficient extension to list and highlight tags like TODO, FIXME, BUG, HACK, and XXX in Visual Studio Code.
✨ Features
- 🔍 Scans code files for comments with tags such as:
- 📁 Displays these comments organized in a tree by files and folders.
- 🎯 Visual highlight on the editor line with the comment.
- 🧠 Persistent cache between sessions.
- 🔄 Automatic update when saving the file.
🚀 Installation
- Open Visual Studio Code.
- Go to the Extensions (Ctrl+Shift+X) tab.
- Search for
JamacioRocha.code-todo.
- Click Install.
🌐 Extension Page
Click here to visit the Code TODO extension page on the Visual Studio Code Marketplace
🛠️ How to Use
- Add comments with the tags in your code:
// TODO: refactor this
// BUG: doesn't work on Firefox
// HACK ugly but necessary
// FIXME: needs null handling here
// XXX: watch out for performance
- Open the
Code TODO side panel (icon in the sidebar).
- View all comments organized by folder/file.
- Click on a tree item to jump directly to the corresponding line in the editor.
src/
└── auth/
└── login.ts
├── [TODO] implement login function (line 3)
├── [BUG] error loading user (line 4)
├── [HACK] temporary solution... (line 5)
├── [FIXME] remove console.log (line 6)
└── [XXX] critical performance... (line 7)
📂 Language Support
The extension scans files with the following extensions:
.ts, .js, .jsx, .tsx, .php, .py, .java
Files inside node_modules, vendor, and out are ignored by default.
🧪 Internal Functionality
1. Activation
When the extension is activated:
- Registers a tree provider (
TreeDataProvider).
- Performs an initial scan of the project files.
- Monitors file saves to update the tree in real-time.
2. Scanning
For each supported file, it:
- Reads all lines of the document.
- Applies a regex looking for:
TODO, FIXME, BUG, HACK, XXX.
- For each occurrence, creates an item of type
TodoItem.
3. Organization
The results are grouped by folder and file structure, forming a navigable tree in the side panel.
4. Highlighting
When a file with tags is open:
- Lines with comments are highlighted with a custom background color.
🔄 Available Command
codeTODO.refresh: Rescans the project and updates the TODO tree manually.
// TODO: — something that still needs to be done.
// BUG: — points to a known bug or issue.
// FIXME: — something wrong that needs fixing.
// HACK: — workaround or temporary solution.
// XXX: — special attention to dangerous or sensitive code.
📝 License
MIT © Jamácio Rocha