Never forget to review code pasted from other sources (like genAI), or AI streamed directly in file.
VS Code Extension – Reminds you to review pasted or AI-generated code blocks across your workspace, allowing tracking and highlighting of these blocks per file.
Here's how Paste Review Reminder highlights areas for review in your editor:
- Code Block Tracking: Automatically tracks pasted or AI-generated code blocks in your workspace.
- Decorations: Highlights tracked blocks in the editor for quick identification.
- Line Change Awareness: Lines are un-highlighted when touched by the cursor (clicked, selected).
- Intelligent Paste Detection: When re-pasting a large block (like a full file), the extension intelligently skips re-highlighting code that you have already reviewed, even if its position has changed.
- Per-File Storage: Saves blocks per file to a manifest (
.pastereview.json), allowing Git versioning. - Checksum Validation: Ensures saved blocks correspond to the current file content, preventing stale highlights.
- Git-Friendly: The saved manifest can be committed to source control to share review status with your team.
The extension uses two distinct paths to determine whether a change constitutes a block of code requiring review:
This path detects a single, large content change that occurs instantly, which is characteristic of a manual paste operation.
- If a single text change introduces more than the number of lines set by
pasteReviewReminder.minimumPasteLines(default: 20 lines), the block is immediately tracked and highlighted.
This path tracks continuous, rapid changes over a short duration, which is characteristic of AI code generation streaming.
- The extension tracks the total number of characters added and the duration of continuous typing activity.
- If, after a brief pause (100ms timeout), BOTH conditions are met, the block is tracked:
- Speed: The calculated typing speed exceeds the
pasteReviewReminder.typingSpeedThreshold(default: 110 characters/sec). - Size: The total number of affected lines exceeds the
pasteReviewReminder.minimumStreamingLines(default: 20 lines).
- Speed: The calculated typing speed exceeds the
- Paste or generate code in your files.
- The extension automatically tracks the new blocks.
- Tracked blocks are highlighted in the editor.
- Move your cursor to a highlighted line or select a block of lines to mark them as "reviewed" and remove the highlight.
- If you re-paste a file, previously reviewed sections will remain un-highlighted.
You can customize the extension via Settings (Cmd+, on Mac, Ctrl+, on Windows/Linux) under Paste Review Reminder. Available configuration options:
-
Enable Intelligent Paste (
pasteReviewReminder.enableIntelligentPaste) When enabled, pasting a large block of code (like a full file) will intelligently skip re-highlighting lines that you have already reviewed. Default:true. -
Minimum Paste Lines (
pasteReviewReminder.minimumPasteLines) Minimum number of lines in a paste to trigger block highlighting. Default:20. -
Minimum Streaming Lines (
pasteReviewReminder.minimumStreamingLines) Minimum number of lines typed quickly (or streamed from AI completions) to trigger block highlighting. Default:20. -
Typing Speed Threshold (
pasteReviewReminder.typingSpeedThreshold) Characters per second threshold to detect fast typing for AI completions. Default:110. -
Highlight Color (
pasteReviewReminder.highlightColor) Background color used to highlight blocks. Note: This setting may not be implemented yet. Default:rgba(255, 200, 100, 0.15).
- Manifest file:
.pastereview.json(created in your workspace root) - Stores per-file blocks with checksums to detect content changes and prevent stale highlights.
For manual installation or testing a built VSIX package:
To build the distributable .vsix file, you need Node.js and the VS Code Extension Manager (vsce) installed globally.
- Install
vsce(if necessary):npm install -g vsce
- Compile TypeScript and Build:
Run the following command from the root of the project directory. This executes the
vscode:prepublishscript defined in yourpackage.json(which runsnpm run compile) and then packages the result.This command will generate a file named similarly tovsce package
paste-review-reminder-0.0.1.vsixin your project root.
Once the .vsix file is built, you can install it into VS Code without going through the Marketplace.
- Open VS Code.
- Go to the Extensions view (
Ctrl+Shift+XorCmd+Shift+X). - Click the
...(More Actions) menu in the top-right of the Extensions panel. - Select
Install from VSIX.... - Navigate to your project root and select the built
.vsixfile. - Click Reload when prompted to activate the extension.
- Open your terminal.
- Run the VS Code command, pointing to the built file:
code --install-extension /path/to/paste-review-reminder-0.0.1.vsix
- Open the VS Code Command Palette (
Ctrl+Shift+PorCmd+ShiftP) and runDeveloper: Reload Windowto activate the extension.
