| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
A VS Code extension ("Partial Diff") that lets users compare text selections within a file, across files, or against the clipboard using VS Code's built-in diff viewer.
Entry flow: src/extension.ts → BootstrapperFactory → Bootstrapper → registers commands and content provider with VS Code.
Adaptor pattern: All VS Code API access is wrapped in adaptors (src/lib/adaptors/) so the core logic is testable without VS Code. TextEditor, WindowAdaptor, WorkspaceAdaptor, and CommandAdaptor each wrap a corresponding VS Code API surface.
Command pattern: Each user action is a Command (interface in src/lib/commands/command.ts) created by CommandFactory. Commands are either TEXT_EDITOR type (receive the active editor) or GENERAL type.
Diff flow: Commands store selections in SelectionInfoRegistry (keyed by text keys: reg1, reg2, clipboard, visible1, visible2). When a diff is requested, DiffPresenter builds partialdiff:// URIs and calls vscode.diff. VS Code then calls ContentProvider.provideTextDocumentContent() to resolve the URI back to text, applying normalization rules via TextProcessRuleApplier.
Text normalization: NormalisationRuleStore loads rules from user config and tracks active/inactive state. TextProcessRuleApplier applies active rules to text before it enters the diff view. The diff title uses ~ instead of ↔ when normalization is active.
| Back | FazBrowse Home | New Git URL |