ryu1kn / vscode-partial-diff

Visual Studio Code Extension. Take a diff of 2 parts of text(s)
https://marketplace.visualstudio.com/items?itemName=ryu1kn.partial-diff
MIT License
184 stars 15 forks source link

Case insensitive comparison option #10

Closed tip2tail closed 7 years ago

tip2tail commented 7 years ago

Hello

The language I work with is case insensitive. As such when I compare two programs I get a lot of false positives in the diff due to text case.

As a feature request, the ability to either exclude or, preferably, highlight a different colour, any case-only diffs.

Thanks t2t

ryu1kn commented 7 years ago

I see, languages like SQL...

This extension is internally using vscode.diff command and the command doesn't support case insensitive text comparison nor allow you to specify different colours. If you really need it, you might want to open an issue on vscode repo.

Meanwhile, we could convert all characters to lower case just before we compare 2 programs but then the characters you'll see in the diff view are all lower case...

tip2tail commented 7 years ago

I have raised this now - https://github.com/Microsoft/vscode/issues/32905

ryu1kn commented 7 years ago

Thanks @tip2tail , I'm closing this issue for now then.

ryu1kn commented 6 years ago

Hi @tip2tail , I've just published v0.5.0 which allows you to normalise texts just before you feed them into the diff view. I'm wondering if you can use this feature to ignore case-only diffs by normalising all characters in the both texts to lower case (or upper case).

"partialDiff.preComparisonTextNormalizationRules": [
  {
    "name": "Capitalise",
    "match": ".*",
    "replaceWith": {"letterCase": "lower"}
  }
]