Proto Drift Inspector
AST-powered drift detection for proto override files vs base framework files.
Instantly see what changed, what's missing, and what's custom — right inside your editor.
Features
Inline Drift Decorations
Highlights appear directly in your proto file with color-coded markers:
| Color |
Meaning |
| Orange |
Missing call — base method call not present in proto |
| Cyan |
Extra call — proto has a call the base doesn't |
| Gold |
Argument mismatch — same call, different arg count |
| Violet |
JSX wrap change — call wrapped in a different JSX element |
| Teal |
Custom method — exists only in proto (not in base) |
CodeLens
Above each method you get clickable lenses:
- Go to base — opens the base file side-by-side, jumps to the matching method
- Drift summary — opens a detailed diff view with highlights
- Custom method — marks proto-only methods
Problems Panel
All drift appears as diagnostics in VS Code's Problems panel with squiggly underlines and severity levels.
Quick Fixes (Code Actions)
Lightbulb suggestions offer:
- Add missing call — inserts the base method call at the right position
- View diff — opens the side-by-side diff for argument mismatches
Side-by-Side Diff View
Compare extracted method code from base and proto with:
- Color-coded inline highlights (non-clashing with native diff colors)
- Text labels and hover messages for each drift type
- Overview ruler markers in the scrollbar
Auto-Refresh
Drift analysis runs automatically when you:
- Open a
.proto.js file
- Save any file
- Switch editor tabs
Status Bar
A clickable status bar item shows:
- Number of drifted methods
- Number of custom proto-only methods
- Click to open the drift quick-pick menu
How It Works
- Open any file ending in
.proto.js
- The extension automatically finds the corresponding base file
- Both files are parsed into ASTs using Babel
- Methods are compared for: call differences, JSX structure changes, wrapper changes, and argument mismatches
- Results appear as inline decorations, CodeLens, diagnostics, and an interactive quick-pick list
Commands
| Command |
Description |
Proto: Inspect Framework Diff |
Manually trigger drift inspection on the active file |
Requirements
- VS Code 1.85.0 or later
- Project must follow the
.proto.js naming convention for override files
- Base files must be resolvable from
node_modules or a configured path
Extension Settings
This extension works out of the box — no configuration needed.
Known Issues
- Only JavaScript files (
.js) are supported; TypeScript support is planned
- Very large files (10,000+ lines) may have slower initial parse times
Release Notes
0.1.1
- Quick Fixes, Go-to-base navigation, Custom method detection
- Inline decorations, Problems panel diagnostics, CodeLens
- JSX wrap change detection, auto-refresh, clickable status bar
0.1.0
- Initial release with AST-based drift detection and diff view
License
MIT