Support case-insensitive comparison in the diff editor (diffEditor.ignoreCase)
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
### Feature request
Add a `diffEditor.ignoreCase` setting so the diff editor can treat text that
differs only in letter case as unchanged — analogous to the existing
`diffEditor.ignoreTrimWhitespace`.
### Motivation
I work on data-warehouse migration projects where I regularly diff two
revisions of the same SQL script set. SQL keywords are case-insensitive, and
different developers and formatting tools emit them differently (`SELECT` vs
`select`, `FROM` vs `from`). The result is that a file with **zero semantic
changes** renders as fully rewritten, and the handful of real changes are
buried under hundreds of false positives.
This is not SQL-specific. The same problem appears in any case-insensitive
language or format:
- SQL / PL-SQL / T-SQL
- Visual Basic / VB.NET, Pascal / Delphi, Fortran, Ada
- HTML tag and attribute names, CSS property names, DNS names, Windows paths
- Legacy INI / config files
In all of these, a case-only difference is **semantically no difference at
all** — the same category of noise that `ignoreTrimWhitespace` already exists
to suppress.
### Current state
`diffEditor.ignoreTrimWhitespace` is currently the only tolerant-comparison
option available. Neither `diffAlgorithm: legacy` nor `advanced` offers case
folding.
This also cannot be solved by an extension. Folder-comparison extensions
(L13 Diff, Compare Folders, etc.) only decide *which* files get paired up —
the comparison itself is performed by the built-in diff editor. So every
extension in the ecosystem inherits this limitation.
### Proposal
```jsonc
"diffEditor.ignoreCase": false // default preserves current behavior
Ideally surfaced the same way ignoreTrimWhitespace is — a setting plus a
toggle in the diff editor's gutter / context menu — so it can be flipped for
a single comparison without editing settings.json.
ignoreTrimWhitespace appears to work by normalizing lines before they reach
the diff algorithm, rather than by modifying the algorithm itself. If that is
accurate, case folding could reuse the same normalization hook and keep the
change well contained.
Prior art
Case-insensitive diff is standard in comparable tools:
GNU diff -i / --ignore-case
Beyond Compare, WinMerge, Araxis Merge, Meld, KDiff3
IntelliJ IDEA's diff viewer
Current workaround
Copy both trees to a temp directory, lower-case every file with tr, then
diff the copies. This does surface the real changes, but the diff displays
mangled content, so every hit has to be manually re-located in the original
file. Running diff -riqw from the shell tells me which files changed but
gives up the editor UI entirely.
Contributor guide
Assessment
This issue has not been assessed yet.