# gruntfuggly/todo-tree architecture

> Architecture diagram of the GitHub repository gruntfuggly/todo-tree, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gruntfuggly/todo-tree
- Repository: https://github.com/gruntfuggly/todo-tree

## Overview

Todo Tree is a VS Code extension for finding comment tags in a workspace, presenting matches in a configurable tree, and highlighting them in open files. The principal workflow is workspace scan → ripgrep matches → tree results → open the tagged location; editor highlighting is a parallel capability. Configuration, tag attributes, colour handling, and icon selection support these features. The README documents the user-facing flow; source excerpts and the SOURCE INDEX show module dependencies, but several implementation details are unsampled, so those relationships are not expanded.

Main entry points: [`src/extension.js`](https://github.com/gruntfuggly/todo-tree/blob/master/src/extension.js) (Extension runtime), [`src/tree.js`](https://github.com/gruntfuggly/todo-tree/blob/master/src/tree.js) (Results tree), [`src/icons.js`](https://github.com/gruntfuggly/todo-tree/blob/master/src/icons.js) (Tag icons), [`src/utils.js`](https://github.com/gruntfuggly/todo-tree/blob/master/src/utils.js) (Search utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_search["Search"]
  node_extension["Extension runtime<br/>[extension.js]"]
  node_ripgrep["Ripgrep search<br/>[ripgrep.js]"]
  node_searchresults["Search results<br/>[searchResults.js]"]
  node_workspace["Workspace files"]
end

subgraph group_presentation["Results and navigation"]
  node_tree["Results tree<br/>[tree.js]"]
end

subgraph group_appearance["Highlights and icons"]
  node_highlights["Editor highlights<br/>[highlights.js]"]
  node_icons["Tag icons<br/>[icons.js]"]
  node_colours["Colour handling<br/>[colours.js]"]
  node_colour_names["Colour names<br/>[colourNames.js]"]
  node_codicon_names["Codicon names<br/>[codiconNames.js]"]
  node_product_icon_names["Product icon names"]
  node_theme_colour_names["Theme colour names"]
end

subgraph group_support["Configuration and utilities"]
  node_attributes["Tag attributes<br/>[attributes.js]"]
  node_config["Configuration<br/>[config.js]"]
  node_utils["Search utilities<br/>[utils.js]"]
end

node_vscode(("VS Code user"))

node_vscode -.->|"starts extension"| node_extension
node_extension -->|"searches with"| node_ripgrep
node_ripgrep -->|"scans files"| node_workspace
node_extension -.->|"collects matches"| node_searchresults
node_extension -->|"shows matches"| node_tree
node_vscode -->|"selects match"| node_tree
node_tree -->|"opens location"| node_workspace
node_vscode -->|"views open files"| node_highlights
node_highlights -->|"reads styling"| node_attributes
node_highlights -->|"uses icons"| node_icons
node_icons -->|"reads icon settings"| node_attributes
node_icons -->|"validates names"| node_codicon_names
node_icons -->|"validates names"| node_product_icon_names
node_icons -->|"checks theme colours"| node_theme_colour_names
node_attributes -->|"reads settings"| node_config
node_config -->|"queries attributes"| node_attributes
node_utils -->|"checks colour names"| node_colour_names
node_utils -->|"checks theme colours"| node_theme_colour_names
node_colours -->|"uses helpers"| node_utils
node_tree -->|"uses helpers"| node_utils
node_tree -->|"uses icons"| node_icons
node_tree -->|"reads settings"| node_config
node_ripgrep -->|"uses helpers"| node_utils
node_extension -->|"uses settings"| node_config
node_extension -->|"uses highlighting"| node_highlights
node_extension -->|"uses tree"| node_tree
node_extension -->|"uses search"| node_ripgrep

click node_extension "https://github.com/gruntfuggly/todo-tree/blob/master/src/extension.js"
click node_ripgrep "https://github.com/gruntfuggly/todo-tree/blob/master/src/ripgrep.js"
click node_searchresults "https://github.com/gruntfuggly/todo-tree/blob/master/src/searchResults.js"
click node_tree "https://github.com/gruntfuggly/todo-tree/blob/master/src/tree.js"
click node_highlights "https://github.com/gruntfuggly/todo-tree/blob/master/src/highlights.js"
click node_icons "https://github.com/gruntfuggly/todo-tree/blob/master/src/icons.js"
click node_attributes "https://github.com/gruntfuggly/todo-tree/blob/master/src/attributes.js"
click node_config "https://github.com/gruntfuggly/todo-tree/blob/master/src/config.js"
click node_utils "https://github.com/gruntfuggly/todo-tree/blob/master/src/utils.js"
click node_colours "https://github.com/gruntfuggly/todo-tree/blob/master/src/colours.js"
click node_colour_names "https://github.com/gruntfuggly/todo-tree/blob/master/src/colourNames.js"
click node_codicon_names "https://github.com/gruntfuggly/todo-tree/blob/master/src/codiconNames.js"
click node_product_icon_names "https://github.com/gruntfuggly/todo-tree/blob/master/src/productIconNames.js"
click node_theme_colour_names "https://github.com/gruntfuggly/todo-tree/blob/master/src/themeColourNames.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_extension,node_ripgrep,node_searchresults,node_workspace,node_vscode toneBlue
class node_tree toneAmber
class node_highlights,node_icons,node_colours,node_colour_names,node_codicon_names,node_product_icon_names,node_theme_colour_names toneMint
class node_attributes,node_config,node_utils toneRose
```

## Components

### Search

- [Extension runtime](https://github.com/gruntfuggly/todo-tree/blob/master/src/extension.js): `src/extension.js`
- [Ripgrep search](https://github.com/gruntfuggly/todo-tree/blob/master/src/ripgrep.js): `src/ripgrep.js`
- [Search results](https://github.com/gruntfuggly/todo-tree/blob/master/src/searchResults.js): `src/searchResults.js`
- **Workspace files**

### Results and navigation

- [Results tree](https://github.com/gruntfuggly/todo-tree/blob/master/src/tree.js): `src/tree.js`

### Highlights and icons

- [Editor highlights](https://github.com/gruntfuggly/todo-tree/blob/master/src/highlights.js): `src/highlights.js`
- [Tag icons](https://github.com/gruntfuggly/todo-tree/blob/master/src/icons.js): `src/icons.js`
- [Colour handling](https://github.com/gruntfuggly/todo-tree/blob/master/src/colours.js): `src/colours.js`
- [Colour names](https://github.com/gruntfuggly/todo-tree/blob/master/src/colourNames.js): `src/colourNames.js`
- [Codicon names](https://github.com/gruntfuggly/todo-tree/blob/master/src/codiconNames.js): `src/codiconNames.js`
- [Product icon names](https://github.com/gruntfuggly/todo-tree/blob/master/src/productIconNames.js): `src/productIconNames.js`
- [Theme colour names](https://github.com/gruntfuggly/todo-tree/blob/master/src/themeColourNames.js): `src/themeColourNames.js`

### Configuration and utilities

- [Tag attributes](https://github.com/gruntfuggly/todo-tree/blob/master/src/attributes.js): `src/attributes.js`
- [Configuration](https://github.com/gruntfuggly/todo-tree/blob/master/src/config.js): `src/config.js`
- [Search utilities](https://github.com/gruntfuggly/todo-tree/blob/master/src/utils.js): `src/utils.js`

### Other components

- **VS Code user**

## Connections

- VS Code user → Extension runtime: starts extension
- Extension runtime → Ripgrep search: searches with (evidence: `README.md`)
- Ripgrep search → Workspace files: scans files (evidence: `README.md`)
- Extension runtime → Search results: collects matches (evidence: `src/extension.js`)
- Extension runtime → Results tree: shows matches (evidence: `README.md`)
- VS Code user → Results tree: selects match (evidence: `README.md`)
- Results tree → Workspace files: opens location (evidence: `README.md`)
- VS Code user → Editor highlights: views open files (evidence: `README.md`)
- Editor highlights → Tag attributes: reads styling (evidence: `src/highlights.js`)
- Editor highlights → Tag icons: uses icons (evidence: `src/highlights.js`)
- Tag icons → Tag attributes: reads icon settings (evidence: `src/icons.js`)
- Tag icons → Codicon names: validates names (evidence: `src/icons.js`)
- Tag icons → Product icon names: validates names (evidence: `src/icons.js`)
- Tag icons → Theme colour names: checks theme colours (evidence: `src/icons.js`)
- Tag attributes → Configuration: reads settings (evidence: `src/attributes.js`)
- Configuration → Tag attributes: queries attributes (evidence: `src/config.js`)
- Search utilities → Colour names: checks colour names (evidence: `src/utils.js`)
- Search utilities → Theme colour names: checks theme colours (evidence: `src/utils.js`)
- Colour handling → Search utilities: uses helpers (evidence: `src/colours.js`)
- Results tree → Search utilities: uses helpers (evidence: `src/tree.js`)
- Results tree → Tag icons: uses icons (evidence: `src/tree.js`)
- Results tree → Configuration: reads settings (evidence: `src/tree.js`)
- Ripgrep search → Search utilities: uses helpers (evidence: `src/ripgrep.js`)
- Extension runtime → Configuration: uses settings (evidence: `src/extension.js`)
- Extension runtime → Editor highlights: uses highlighting (evidence: `src/extension.js`)
- Extension runtime → Results tree: uses tree (evidence: `src/extension.js`)
- Extension runtime → Ripgrep search: uses search (evidence: `src/extension.js`)
