# fanaticpythoner/better-todo-tree architecture

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

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

## Overview

Better Todo Tree is a VS Code extension that finds configured TODO-style tags across a workspace, presents matches in a tree, and highlights them in open files. Its main runtime is coordinated by the extension entry point, which integrates workspace search, result handling, tree views, and editor decorations. Detection also supports language-specific comment patterns and embedded documents; notebook scanning and legacy-setting migration are documented capabilities. The graph follows documented workflows and visible source references; unsampled modules are included where the README establishes their role, without assuming their internal call wiring.

Main entry points: [`src/extension.js`](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/extension.js) (Extension Controller), [`src/detection.js`](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/detection.js) (Tag Detection), [`src/embeddedDocuments.js`](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/embeddedDocuments.js) (Embedded Documents), [`src/config.js`](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/config.js) (Configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Extension Runtime"]
  node_extension["Extension Controller<br/>[extension.js]"]
  node_notebooks["Notebook Scanning<br/>[notebooks.js]"]
  node_settings_snapshot["Settings Snapshot"]
  node_document_cache["Document Scan Cache"]
end

subgraph group_scanning["Search and Detection"]
  node_ripgrep_search["Workspace Search<br/>[ripgrep.js]"]
  node_detection["Tag Detection<br/>[detection.js]"]
  node_regex_engine["Regex Engine<br/>[regexEngine.js]"]
  node_regex_registry["Regex Registry<br/>[regexRegistry.js]"]
  node_embedded_docs["Embedded Documents"]
  node_html_parser["HTML-like Parser"]
end

subgraph group_presentation["Results and Display"]
  node_search_results["Search Results<br/>[searchResults.js]"]
  node_tree["Todo Tree View<br/>[tree.js]"]
  node_highlights["Editor Highlights<br/>[highlights.js]"]
  node_icons["Tree and Gutter Icons<br/>[icons.js]"]
end

subgraph group_configuration["Settings and Language"]
  node_config["Configuration<br/>[config.js]"]
  node_identity["Setting Migration"]
  node_attributes["Tag Attributes<br/>[attributes.js]"]
  node_language_config["Language Configuration"]
  node_pattern_catalog["Comment Pattern Catalog"]
  node_pattern_resolver["Language Pattern Resolver"]
end

node_vscode_user(("VS Code User"))
node_vscode["VS Code API"]
node_rg["ripgrep"]

node_vscode_user -->|"uses extension"| node_extension
node_extension -->|"registers features"| node_vscode
node_extension -->|"searches workspace"| node_ripgrep_search
node_ripgrep_search -->|"runs searches"| node_rg
node_extension -->|"normalizes matches"| node_detection
node_detection -->|"uses regex tools"| node_regex_engine
node_detection -->|"scans embedded content"| node_embedded_docs
node_embedded_docs -->|"uses parser"| node_html_parser
node_embedded_docs -->|"uses language rules"| node_language_config
node_embedded_docs -->|"resolves comment patterns"| node_pattern_catalog
node_regex_engine -->|"uses registry"| node_regex_registry
node_detection -->|"builds tag patterns"| node_regex_registry
node_extension -->|"manages matches"| node_search_results
node_extension -->|"updates tree view"| node_tree
node_extension -->|"refreshes highlights"| node_highlights
node_highlights -->|"gets scan results"| node_detection
node_tree -->|"gets icons"| node_icons
node_extension -.->|"scans notebooks"| node_notebooks
node_extension -->|"builds settings snapshot"| node_settings_snapshot
node_extension -->|"caches document scans"| node_document_cache
node_extension -->|"initializes settings"| node_config
node_config -->|"resolves setting namespace"| node_identity
node_config -->|"uses tag attributes"| node_attributes
node_extension -->|"creates language resolver"| node_pattern_resolver
node_pattern_resolver -->|"uses pattern catalog"| node_pattern_catalog
node_vscode_user -->|"opens matching file"| node_tree
node_vscode_user -->|"views highlights"| node_highlights

click node_extension "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/extension.js"
click node_notebooks "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/notebooks.js"
click node_settings_snapshot "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/runtime/settingsSnapshot.js"
click node_document_cache "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/runtime/documentScanCache.js"
click node_ripgrep_search "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/ripgrep.js"
click node_detection "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/detection.js"
click node_regex_engine "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/regexEngine.js"
click node_regex_registry "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/regexRegistry.js"
click node_embedded_docs "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/embeddedDocuments.js"
click node_html_parser "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/htmlLikeEmbeddedDocumentParser.js"
click node_search_results "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/searchResults.js"
click node_tree "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/tree.js"
click node_highlights "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/highlights.js"
click node_icons "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/icons.js"
click node_config "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/config.js"
click node_identity "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/extensionIdentity.js"
click node_attributes "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/attributes.js"
click node_language_config "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/customLanguageConfiguration.js"
click node_pattern_catalog "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/commentPatternCatalog.js"
click node_pattern_resolver "https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/commentPatternLanguageResolver.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_notebooks,node_settings_snapshot,node_document_cache,node_vscode_user toneBlue
class node_ripgrep_search,node_detection,node_regex_engine,node_regex_registry,node_embedded_docs,node_html_parser toneAmber
class node_search_results,node_tree,node_highlights,node_icons,node_vscode toneMint
class node_config,node_identity,node_attributes,node_language_config,node_pattern_catalog,node_pattern_resolver toneRose
class node_rg toneIndigo
```

## Components

### Extension Runtime

- [Extension Controller](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/extension.js): `src/extension.js`
- [Notebook Scanning](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/notebooks.js): `src/notebooks.js`
- [Settings Snapshot](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/runtime/settingsSnapshot.js): `src/runtime/settingsSnapshot.js`
- [Document Scan Cache](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/runtime/documentScanCache.js): `src/runtime/documentScanCache.js`

### Search and Detection

- [Workspace Search](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/ripgrep.js): `src/ripgrep.js`
- [Tag Detection](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/detection.js): `src/detection.js`
- [Regex Engine](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/regexEngine.js): `src/regexEngine.js`
- [Regex Registry](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/regexRegistry.js): `src/regexRegistry.js`
- [Embedded Documents](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/embeddedDocuments.js): `src/embeddedDocuments.js`
- [HTML-like Parser](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/htmlLikeEmbeddedDocumentParser.js): `src/htmlLikeEmbeddedDocumentParser.js`

### Results and Display

- [Search Results](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/searchResults.js): `src/searchResults.js`
- [Todo Tree View](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/tree.js): `src/tree.js`
- [Editor Highlights](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/highlights.js): `src/highlights.js`
- [Tree and Gutter Icons](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/icons.js): `src/icons.js`

### Settings and Language

- [Configuration](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/config.js): `src/config.js`
- [Setting Migration](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/extensionIdentity.js): `src/extensionIdentity.js`
- [Tag Attributes](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/attributes.js): `src/attributes.js`
- [Language Configuration](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/customLanguageConfiguration.js): `src/customLanguageConfiguration.js`
- [Comment Pattern Catalog](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/commentPatternCatalog.js): `src/commentPatternCatalog.js`
- [Language Pattern Resolver](https://github.com/fanaticpythoner/better-todo-tree/blob/master/src/commentPatternLanguageResolver.js): `src/commentPatternLanguageResolver.js`

### Other components

- **VS Code User**
- **VS Code API**
- **ripgrep**

## Connections

- VS Code User → Extension Controller: uses extension (evidence: `README.md`)
- Extension Controller → VS Code API: registers features (evidence: `src/extension.js`)
- Extension Controller → Workspace Search: searches workspace (evidence: `src/extension.js`)
- Workspace Search → ripgrep: runs searches (evidence: `src/ripgrep.js`)
- Extension Controller → Tag Detection: normalizes matches (evidence: `src/extension.js`)
- Tag Detection → Regex Engine: uses regex tools (evidence: `src/detection.js`)
- Tag Detection → Embedded Documents: scans embedded content (evidence: `src/detection.js`)
- Embedded Documents → HTML-like Parser: uses parser (evidence: `src/embeddedDocuments.js`)
- Embedded Documents → Language Configuration: uses language rules (evidence: `src/embeddedDocuments.js`)
- Embedded Documents → Comment Pattern Catalog: resolves comment patterns (evidence: `src/embeddedDocuments.js`)
- Regex Engine → Regex Registry: uses registry (evidence: `src/regexEngine.js`)
- Tag Detection → Regex Registry: builds tag patterns (evidence: `src/detection.js`)
- Extension Controller → Search Results: manages matches (evidence: `src/extension.js`)
- Extension Controller → Todo Tree View: updates tree view (evidence: `src/extension.js`)
- Extension Controller → Editor Highlights: refreshes highlights (evidence: `src/extension.js`)
- Editor Highlights → Tag Detection: gets scan results (evidence: `src/highlights.js`)
- Todo Tree View → Tree and Gutter Icons: gets icons (evidence: `src/tree.js`)
- Extension Controller → Notebook Scanning: scans notebooks (evidence: `src/extension.js`)
- Extension Controller → Settings Snapshot: builds settings snapshot (evidence: `src/extension.js`)
- Extension Controller → Document Scan Cache: caches document scans (evidence: `src/extension.js`)
- Extension Controller → Configuration: initializes settings (evidence: `src/extension.js`)
- Configuration → Setting Migration: resolves setting namespace (evidence: `src/config.js`)
- Configuration → Tag Attributes: uses tag attributes (evidence: `src/config.js`)
- Extension Controller → Language Pattern Resolver: creates language resolver (evidence: `src/extension.js`)
- Language Pattern Resolver → Comment Pattern Catalog: uses pattern catalog (evidence: `src/commentPatternLanguageResolver.js`)
- VS Code User → Todo Tree View: opens matching file (evidence: `README.md`)
- VS Code User → Editor Highlights: views highlights (evidence: `README.md`)
