Skip to content

Latest commit

 

History

History
97 lines (72 loc) · 4.39 KB

AGENTS.md

File metadata and controls

97 lines (72 loc) · 4.39 KB

Todo+2

TypeScript, VS Code extension (vscode API ^1.36), webpack, moment-mini, mocha+chai.

Development: Node.js 22.12+ on 22.x or Node.js 24; pnpm 10.33.4 is pinned in package.json. Run corepack enable pnpm before setup. The extension still targets VS Code 1.36 / Node 10.11; retain the compiler/API pins.

Commands

pnpm install --frozen-lockfile # reproducible install
pnpm run compile      # webpack dev build → out/
pnpm run compile:watch
pnpm run test         # mocha tests in test/
pnpm run typecheck    # TypeScript source and test checks
pnpm run check        # types, tests, development build, formatting
pnpm run format       # prettier --write
pnpm run format:check
pnpm run package     # production VSIX, bundled deps, no dependency collection
pnpm run publish     # VS Code Marketplace only; never use bare pnpm publish

Debug: open in VS Code, F5 launches Extension Dev Host. Sourcemaps active — breakpoints in src/ work.

CHANGELOG

User-visible changes go in CHANGELOG.md, newest version at top. Each version header is ### Version X.Y.Z. Group entries under feature additions or fixes. Link GitHub issue numbers when applicable. Always update it in the same PR that adds or changes user-facing behaviour.

Branching & PRs

  • master = stable (v5.2.0 latest published)
  • develop = next release. All PRs target develop.
  • Branch naming: feat/ (feature), fix/ (bug)
  • Keep PRs small and focused. Squash merge.

Code style

// Prettier formatting. Single-quote strings. 2-space indent. Semicolons.
// Classes use decorators. Everything else is plain functions/consts.

// Export named, never default
export const activate = (context: ExtensionContext): void => { ... };

// Commands register in commands.ts, not extension.ts
// Extension.ts wires disposables and subscriptions only
// Types from vscode never imported as wildcard — import type { ... } from 'vscode'

Architecture

  • src/extension.ts — activation, disposable registration, event wiring
  • src/commands.ts — all command registrations
  • src/todo/document.ts — .todo file parser/serializer (the core model)
  • src/todo/items/ — domain types: Todo, Project, Tag, Comment, Archive, Line
  • src/todo/decorators/ — VS Code text editor decorations per item type
  • src/providers/ — language features: completion, dependency links, symbols
  • src/views/ — tree views: files, embedded todos
  • src/statusbars/ — statistics + timer status bar items
  • src/utils/embedded/providers/ — ag, rg, js backends for embedded code todos

Task sources:

  1. .todo files (structured project/todo format)
  2. Embedded todos (regex-extracted from code comments)
  3. Markdown notes (markdown-tasks.ts / task-source.ts), sharing the Files and Due views and task commands with Todo files. Keep original source ranges and marker styles; do not parse prose or code examples as tasks.

Key constraints

  • No runtime npm deps beyond vscode API. moment-mini (aliased from moment) is the only exception.
  • @id / @depends must stay portable. IDs are plain text, survive copy/move/archive. Cross-file resolution via dependency_index.ts.
  • Archive: completed items move under an "Archive" project. Configurable storage: same file, single workspace file, or per-file.
  • Event propagation: .todo file edits re-parse → fire events → views/stats/decorations update reactively.

Boundaries

  • Never modify generated output in out/, dist/, or node_modules/
  • Never add runtime dependencies without explaining why in the PR
  • Follow symlinks only when todo.followSymlinks is enabled (default: false)

Config

All settings under todo.*. Key prefix groups:

  • todo.file.* — file discovery, includes/excludes, default content
  • todo.symbols.* — box/done/cancelled characters
  • todo.colors.* — per-element colors (done, project, tag, id, dependency, etc.)
  • todo.timekeeping.* — @created, @started, @done, @lasted format
  • todo.archive.* — archive behaviour and storage type
  • todo.statistics.* — project & statusbar stats
  • todo.timer.* — statusbar timer for started todos
  • todo.embedded.* — embedded todos batch size and comment visibility
  • todo.markdown.* — Markdown task discovery and section scoping
  • todo.followSymlinks — follow symlinks during file enumeration

Types are in src/config.ts. Defaults in package.json under contributes.configuration.properties.