Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>XLSX CompareNew to Visual Studio Code? Get it now.
XLSX Compare

XLSX Compare

Sagasys Technology Group

|
1,974 installs
| (0) | Free
Compare XLSX files with git commits
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

XLSX Compare Extension

A VS Code extension for comparing XLSX files with git commits, specifically designed for Oracle Intelligent Advisor development workflows.

Features

  • 🎯 Comparison-only by default - Normal Explorer clicks leave .xlsx files to VS Code's default behavior or your chosen editor
  • 📊 Intelligent Git Integration - Seamlessly integrates with VS Code's git extension for diff operations
  • � Standalone File Comparison - Compare any two XLSX files without requiring git
  • �🔍 Excel-like Diff Viewer - Source-formatted grid with distinct markers for additions, deletions, modifications, and formatting-only changes
  • 📈 Multi-worksheet Support - Handle complex Excel files with multiple sheets
  • 🔧 Formula Change Detection - See changes in Excel formulas, not just values
  • 📋 Context Menu Integration - Right-click any .xlsx file to compare
  • ⚡ Automatic Diff Detection - Works with staged changes, commit comparisons, and file history

Installation

  1. Clone this repository
  2. Run npm install to install dependencies
  3. Run npm run compile to build the extension
  4. Press F5 to open a new Extension Development Host window
  5. Test the extension with your XLSX files

Usage

Automatic Git Integration

The extension handles comparison tabs without becoming the default editor for ordinary .xlsx file opens:

  • Git diff operations automatically open in the XLSX diff viewer
  • Staged changes can be viewed by clicking on XLSX files in the Source Control panel
  • Commit history comparisons work seamlessly when browsing git logs
  • Source Control Graph revision comparisons use the selected commits, including Git URIs with a .git suffix

Optional RulesCraft-assisted OPM comparisons

When RulesCraft (SagasysTechnologyGroup.rulescraft) exposes workbookAnalysis API v1 in a trusted workspace, XLSX Compare analyzes the exact two compared buffers, including historical Git/PR versions. No Oracle compilation, project data model, working-file cache, or unsaved editor contents are used. Older or absent RulesCraft versions keep generic comparison; analysis failures warn and fall back explicitly. Set xlsxCompare.useRulesCraft to false to disable this integration.

Named OPM styles identify individual rule-table boundaries. Unique matching conclusion headings identify tables; unique named headings match columns within each table. Unique keys from the shared condition columns match rows while preserving their order. This handles different column shifts in separate tables on the same sheet. New conditions, conclusion edits, formulas, and OPM role/style changes remain differences. Repeated keys remain additions/deletions rather than guessed matches; ambiguous table matches, reordered rows, merged ranges, and unsupported layouts retain generic alignment. These are named-style hints, not compiler-validated semantic equivalence; canonical model-attribute matching is not yet provided.

Equivalent custom indexed-palette and RGB fill colors are normalized even without RulesCraft. Real formatting changes remain visible and are labeled formatting only when the cell content and OPM role are unchanged. The viewer's Highlight formatting-only changes checkbox suppresses their highlighting/summary entries without hiding cell contents. Totals always include them. Hover a moved matched cell to see its counterpart address.

Applying a cell still copies to the same working-file address, not the matched address. It never inserts rows/columns or translates formulas; inspect the merge preview carefully after structural edits.

  • File comparisons work directly from VS Code's built-in git features

If you previously selected XLSX Diff Viewer as the default, use Reopen Editor With... → Configure default editor to choose another editor, or remove the *.xlsx mapping to xlsxCompare.diffViewer from your user/workspace workbench.editorAssociations setting. An explicit editor association overrides the extension's optional priority.

Workbook-style viewer

The compact top summary doubles as a change-marker legend and shows workbook totals and the active sheet's added/deleted/modified/formatting-only counts. Formatting-only changes count separately from content modifications, not twice. Versions and alignment details expands the full revision labels and alignment information. The grids use the available window height, retain sticky coordinate headers, and show both versions side by side (stacked in narrow windows). Worksheet tabs sit below the grids and retain their change-count badges.

  • Select a cell to inspect its complete raw value or formula in the read-only fx bar, together with its original address, version, matched counterpart address, and named style (including OPM roles).
  • Use arrow keys to navigate, Shift+arrows to extend a rectangular selection, Home/End within a row, or Ctrl/Cmd+Home/End within the grid. Ctrl/Cmd-click toggles cells; Escape clears selection. The existing 256-cell selection limit and single-version merge behavior are unchanged.
  • Focus worksheet tabs and use Left/Right or Home/End to switch sheets. Switching sheets clears the previous selection.
  • Expand Summary of all changes, then select a cell address to jump to that exact source cell. High-contrast badges identify change types using both color and shape: teal square + added, rose circle - deleted, blue diamond ~ modified, and purple dashed rectangle F formatting-only. Color is limited to the icons, including the matching legend and summary icons; workbook fills and transparent gutters stay untouched. High-contrast themes and forced-color mode use theme/system colors while retaining the symbols and shapes.
  • A thin perimeter marks selected cells. The active cell has a stronger black/white outline and underlined row/column headers; its counterpart has a dashed outline but is not included in the merge selection. The details bar names the selected change type and OPM role.
  • Use the Previous change / Next change arrows at the top to cycle through changed cells across worksheets, wrapping at either end. Modified cells count once, not once per version; deletions select the previous version. The position counter follows selected changes, and disabling formatting-only highlighting also skips those changes and reports how many are hidden.
  • Formatting-only highlighting, working-file match indicators, path copying, and context-menu merge commands remain available. Applying changes still targets the same working-file addresses, not counterpart addresses.

Cells retain each version's original fonts, solid fills, borders, alignment, wrapping, and formatted numbers/dates. Named-style inheritance preserves OPM condition/conclusion headings, body cells, and else formatting, where appearance is part of the rule syntax. Workbook styles are read directly from the compared XLSX buffers; this display does not require RulesCraft. Indexed palettes and theme/tint colors are resolved, including historical versions. Column widths are approximated from Excel character units, and row heights are retained where content fits.

The surrounding UI follows the VS Code theme; the sheet keeps its own colors, including in dark themes. Each cell reserves annotation space beside its source content, so markers never cover text. This space is transparent and has no separator border, blending into the source fill instead of forming visible gutters. Only the markers have contrasting backgrounds. Displayed columns are 30 pixels wider to retain source content width; rows are at least 20 pixels high to fit readable markers. W in a separate strip position means the cell matches the working-file snapshot; selected-cell details also report this match. Disabling formatting-only highlighting removes the F annotations, not the underlying workbook formatting.

This is not a full Excel renderer: conditional formatting, rich-text runs, patterned/gradient fills, text rotation, merged-cell display, hidden rows/columns, and freeze panes are not reproduced. Hidden data remains visible for comparison. Missing fonts use browser fallbacks; wrapping can increase row height. Number/date display uses SheetJS formatting, not Excel's locale-specific rendering.

Manual Comparison Commands

The extension provides multiple ways to compare XLSX files, accessible via right-click context menu or Command Palette (Ctrl+Shift+P):

1. Compare XLSX: Compare two git commits

  • Purpose: Compare any XLSX file between two different git commits
  • Usage:
    • Right-click on any .xlsx file → "Compare XLSX: Compare two git commits"
    • Or use Command Palette: "Compare XLSX: Compare two git commits"
  • What it does: Opens a picker to select two commits and shows the differences between them

2. Compare XLSX: Compare current file with Git HEAD (Latest Commit)

  • Purpose: Compare the current working version with the latest committed version
  • Usage:
    • Right-click on any .xlsx file → "Compare XLSX: Compare current file with Git HEAD"
    • Or use Command Palette: "Compare XLSX: Compare current file with Git HEAD"
  • What it does: Instantly compares your current file with the HEAD commit

3. Compare XLSX: Compare any two files

  • Purpose: Compare any two XLSX files from anywhere on your system (no git required)
  • Usage:
    • Right-click on any .xlsx file → "Compare XLSX: Compare any two files"
    • Or use Command Palette: "Compare XLSX: Compare any two files"
    • Or from Command Palette without selecting a file first
  • What it does: Opens file pickers to select two XLSX files for comparison
  • Perfect for: Non-git workflows, comparing files from different locations, or comparing backups

4. Two-Step File Selection (New!)

  • Purpose: Select one file, then easily compare others against it (like a "clipboard" for comparisons)
  • Step 1: Right-click any .xlsx file → "Compare XLSX: Select file for comparison"
  • Step 2: Right-click any other .xlsx file → "Compare XLSX: Compare with selected file"
  • Benefits:
    • Compare multiple files against the same reference file
    • No need to re-select the first file each time
    • Great for comparing several variations against an original
    • Clear visual feedback showing which file is selected

Git Integration Examples

  • View staged changes: Click on any XLSX file in the "Staged Changes" section
  • View working directory changes: Click on any XLSX file in the "Changes" section
  • Compare commits: Use the Git Graph or Git History extensions, then click on XLSX files
  • Review pull requests: XLSX files in PR diffs automatically open in the custom viewer

Non-Git Usage Examples

  • Compare different versions: Select any two XLSX files from your file system
  • Compare backups: Compare current file with backup copies
  • Cross-project comparison: Compare files from different folders or drives
  • Template comparison: Compare a customized file with its original template

How It Works

XLSX Parsing

  • Uses the xlsx library to parse Excel files into structured data
  • Handles multiple worksheets, formulas, and cell values
  • Preserves formula information (shows =SUM(A1:A10) rather than just the result)

Git Integration

  • Extracts XLSX files from any git commit using git show
  • Supports relative paths and workspace detection
  • Handles binary file extraction properly

Diff Visualization

  • Green cells: Added content
  • Red cells: Deleted content
  • Yellow cells: Modified content
  • Sheet-level changes: New/deleted worksheets
  • Formula highlighting: Distinguishes formulas from values

Perfect for Oracle Intelligent Advisor

This extension is specifically designed for teams working with:

  • Excel-based rule authoring with full git integration
  • Spreadsheet version control with automatic diff detection
  • Collaborative spreadsheet development with seamless VS Code integration
  • Excel file change tracking that works with all git workflows
  • Code review processes involving XLSX files

Why This Matters for OIA Development

Traditional git diff tools show XLSX files as binary blobs with no meaningful comparison. This extension:

  • Reveals actual content changes in rules, decision tables, and data structures
  • Shows formula modifications that affect business logic
  • Tracks worksheet additions/deletions that represent new rule sets
  • Integrates with standard git workflows without requiring separate tools

Technical Details

Architecture

  • Extension Host: Main VS Code extension logic
  • XLSX Comparer: Core comparison engine using xlsx.js
  • Git Integration: Command-line git integration for file extraction
  • Webview Provider: Custom UI for displaying diffs

File Support

  • .xlsx files (Excel 2007+ format)
  • Multiple worksheets
  • Formulas and values
  • Git repositories

Development

Building

npm install
npm run compile

Testing

npm run test

Packaging

npm run package

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Submit a pull request

Requirements

  • VS Code 1.74.0 or higher
  • Git installed and accessible from command line
  • Workspace must be a git repository for comparison features

Important Notes

  • Automatic Setup: The extension automatically registers as the default editor for .xlsx files
  • Git Integration: Works seamlessly with VS Code's built-in git features and popular git extensions
  • No Configuration Required: Start using immediately after installation

Known Limitations

  • Binary Excel files only (.xlsx, not .xls)
  • Requires git command-line tools
  • Large files may take time to process
  • Formatting/styling changes not yet detected

Development & Testing

If you're developing with this extension:

  1. Build the extension:

    npm run compile
    
  2. Create sample XLSX files for testing:

    npm run create-sample
    
  3. Test scenarios:

    • Open any .xlsx file to see automatic diff integration
    • Use git staging to test staged changes comparison
    • Navigate git history to test commit comparisons
    • Try manual commands from Command Palette for specific comparisons

Contributing

Feel free to contribute improvements or report issues on the project repository.

License

MIT License - see LICENSE file for details.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft