microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.98k stars 29.53k forks source link

Provide ability to ignore all whitespace in diff editor (feature request) #43026

Open simonl65 opened 6 years ago

simonl65 commented 6 years ago

Steps to Reproduce:

  1. In settings it's possible to set "diffEditor.ignoreTrimWhitespace": true
  2. There's no option to ignore all whitespace,

Would it be possible to add "diffEditor.ignoreAllSpaces": true? I believe the command-line to achieve this would be something like git diff --ignore-space-at-eol -b -w [commit]...

h/t Daniel Gomez @ coderwall

[edit] Might only need -w ? [/edit]

drschwabe commented 2 years ago

since there seems to be no feedback for VS code , can someone suggest other tool for visual diff that does ignore white space ?

Sublime Merge has this feature. You can right click anywhere in a given file in diff view and choose "Hide Whitespace Changes" (or "Show Whitespace Changes" to toggle them back)

ahernsean commented 2 years ago

since there seems to be no feedback for VS code , can someone suggest other tool for visual diff that does ignore white space ?

One of the things that's so strange about this is that most other diff tools have this ability. I use Meld, but there are many others.

MCEmperor commented 2 years ago

since there seems to be no feedback for VS code , can someone suggest other tool for visual diff that does ignore white space ?

TortoiseGit also has this ability.

l87y7m commented 2 years ago

since there seems to be no feedback for VS code , can someone suggest other tool for visual diff that does ignore white space ?

Beyond Compare

blakeVersigaWPE commented 2 years ago

Does anyone know how to integrate beyond compare into vscode that would replace the default diff tool? Is there a document that includes setup steps??

I need this to work when a file is clicked in the source control tab which shows diffs from the previous revision.

TIA

On Wed, Jul 13, 2022 at 4:10 PM Shawn Mannen @.***> wrote:

since there seems to be no feedback for VS code , can someone suggest other tool for visual diff that does ignore white space ?

Beyond Compare

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/43026#issuecomment-1183681370, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARFVN6GIXY45QT3A4YGI54LVT4WENANCNFSM4EPLEUUA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Blake Versiga

Business Title

Enterprisewide Programmer Analyst, Principal

E: @. @.> M: 214-755-1772

WP Engine, Inc. 504 Lavaca Street, Suite 1000 Austin, Texas 78701

wpengine.com | twitter https://twitter.com/wpengine | careers http://wpengine-careers.com/ | torquemag.io | velocitize.com

Lexicality commented 2 years ago

Personally I just configured git to use https://github.com/dandavison/delta and compare in the terminal with git diff -w, it required the least integration work from what I could see.

movy commented 2 years ago

4 years and counting!

sameer-namshi commented 2 years ago

let's build a plugin, Is someone up for contribution?

samhowle commented 2 years ago

Would love to have this implemented and ideally with a toggle button on the diff editor just like how the existing Leading/Trailing Whitespace diff button is set up, but also to include differences in blank lines.

Aaron-Corp00 commented 2 years ago

This is a fairly critical feature for a diffing tool. I'm surprised its not implemented.

Pulseczar1 commented 2 years ago

@Aaron-Corp00 I've noticed a few oddly missing features in VSCode. My guess is that they need a reason for you to pay money for the full Visual Studio, which I won't be doing, since it's limited to Windows. When Windows joins the rest of the world and has a Linux or UNIX (or very similar) kernel, I might use Windows again.

hongwen000 commented 2 years ago

+1 for this

arcataroger commented 2 years ago

another +1 for this, still useful 4 years later!

jeremymarx commented 2 years ago

Since this request seems to be ignored by those who can make a difference, I'd like to attempt to rephrase it:

The lack of this standard feature (come on, ALL the other diff tools have had this for years) makes the diff editor very difficult to use in many circumstances and thus forces many of us to LEAVE THE TOOL to get things done.

arcataroger commented 2 years ago

Does VScode have a bug bounty program? Can we sponsor this feature somehow?

blakeVersigaWPE commented 2 years ago

I am willing to help sponsor this! This basic feature omission cost me hours a week!

On Thu, Oct 13, 2022 at 4:06 PM Roger @.***> wrote:

Does VScode have a bug bounty program? Can we sponsor this feature somehow?

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/43026#issuecomment-1278178746, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARFVN6E53NRUMREX7XQKWLTWDB2VJANCNFSM4EPLEUUA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Blake Versiga

Business Title

Enterprisewide Programmer Analyst, Principal

E: @. @.> M: 214-755-1772

WP Engine, Inc. 504 Lavaca Street, Suite 1000 Austin, Texas 78701

wpengine.com | twitter https://twitter.com/wpengine | careers http://wpengine-careers.com/ | torquemag.io | velocitize.com

arcataroger commented 2 years ago

Same! This is one of the big omissions that keeps me on IntelliJ. Would be happy to help sponsor this.

MaximillianC commented 2 years ago

This is definitely a frustrating omission in functionality. Doing Control-A-K-F to auto-format a page should not result in code reviewers being forced to dig through files dozens of simple spacing differences ADO pull request file diffs, just to see if there's any actual substantial change that needs reviewed. This wastes a lot of my team's time. Please fix this soon.

12bchl commented 2 years ago

+1 please

feedanal commented 2 years ago

312 likes over 4+ years and still not implemented??? How are these issues get prioritized I wonder...

CTimmerman commented 2 years ago

312 likes over 4+ years and still not implemented??? How are these issues get prioritized I wonder...

Business value maybe. As mentioned above old Visual Studio might have this feature, but so do competitors. Anyway, i wrote a little filter that also ignores newlines which even TortoiseGitMerge can't: https://github.com/CTimmerman/codediff It lacks forgotten polish as my old team didn't appreciate it despite their large PR diff complaints.

I've already upvoted the main post here so a +1 comment would merely spam all watchers/fixers on this issue. Can GitHub even sort by OP upvote emojis like Bugzilla does proper built-in votes? I don't think so, as even ?w=1 lacks a button.

VS Code's current diff whitespace toggle looks like a frontend hack, but there are also three other interesting files: https://github.com/microsoft/vscode/blob/db0c4da8f0d760da3dae2e095b66541b08a000ad/src/vs/editor/common/diff/smartLinesDiffComputer.ts line 16 and 496, https://github.com/microsoft/vscode/blob/db0c4da8f0d760da3dae2e095b66541b08a000ad/src/vs/editor/common/diff/standardLinesDiffComputer.ts#L23 which doesn't mention ignore, and https://github.com/microsoft/vscode/blob/db0c4da8f0d760da3dae2e095b66541b08a000ad/src/vs/base/common/diff/diff.ts#L231 which doesn't mention ignore and looks more low level. It's more work than simply adding an external tool's parameter, so adding a button to launch an external tool pointing to current (temp) files might be faster.

et304383 commented 2 years ago

Good lord, over 4 and a half years later...

nateharward commented 2 years ago

+1 for this please

netniV commented 2 years ago

I've already upvoted the main post here so a +1 comment would merely spam all watchers/fixers on this issue. Can GitHub even sort by OP upvote emojis like Bugzilla does proper built-in votes? I don't think so, as even ?w=1 lacks a button.

If you haven't used the Refined GitHub plugin, that may be what makes a button appear for that to me. Because I have one.

image

image

Just a shame there's still no way to do this in VSC properly.

edson-nascimento commented 1 year ago

+1 we need this feature

liqiang311 commented 1 year ago

+1 we need this feature

ip75 commented 1 year ago

I'd add ability to skip comments in auto-generated files. When many developers in project versions of code generators might be different. It's mentioned usually in comments.

ssi-john-quirol commented 1 year ago

+1 for this feature, please

mmueller2012 commented 1 year ago

I am working on an extension that ignores irrelevant changes (like whitespaces outside of strings) based on the grammar rules of the programming language. The number of supported languages is quite small so far, but maybe it is useful to some of you.

andreas-nielsen-xlo commented 1 year ago

+1, we need this feature. The is nice, but we also need the "ignore ALL whitespace" option.

CTimmerman commented 1 year ago

I suppose a +1 a day keeps the stalebot away, but is there a way to only get notified for useful comments like https://github.com/microsoft/vscode/issues/43026#issuecomment-1429011549 ?

Shubham9123 commented 1 year ago

+1 for this feature

Iaotle commented 1 year ago

+1, really would like to see this implemented ASAP.

reisept commented 1 year ago

+1 a day keeps the stale bot away and maybe catches some dev attention

brianjmurrell commented 1 year ago

@reisept No it doesn't. It just spams everyone that is watching this issue. +1s are not going to attract dev attention but will attract the ire of everyone who gets spammed by it. Clicking the :+1: (as 354 people have done in this issue so far) in the first comment is the nice way to show your desire for a feature and not annoy lots of people.

lanwatch commented 1 year ago

+1 a day keeps the stale bot away and maybe catches some dev attention

netniV commented 1 year ago

Given it's been five years since the original request was opened, I suspect they may have muted it.

Shubham9123 commented 1 year ago

Given it's been five years since the original request was opened, I suspect they may have muted it.

That is actually so sad :/

wizofaus commented 1 year ago

I am working on an extension that ignores irrelevant changes (like whitespaces outside of strings) based on the grammar rules of the programming language. The number of supported languages is quite small so far, but maybe it is useful to some of you.

That sounds more useful - really the only reason I've ever wanted "ignore ALL whitespace" is because I can see that the only whitespace differences being shown are semantically meaningless (e.g. between tokens). But there is a risk if I turn on such an option it will hide whitespace changes inside literal strings etc. that do have an impact on the program behaviour. Having said that, I was looking for something for Visual Studio, not VS code...

jason-koppel-avlino commented 1 year ago

+1 on needing to ignore all whitespace changes like every other file diff software gives.

vhnatyk commented 1 year ago

ignore whitespaces needed!!! :(

wlyssescerqueira commented 1 year ago

+1 for this feature, please

pvihan commented 1 year ago

+1

Hi VScode team. Your product is great but lacks one this crucial feature. Source reformatting makes diff impossible (irrelevant whitespace changes). Other competing tools (IDEA, WinMerge, TortoiseGit diff etc.) all have ability to ignore ALL whitespaces. Please consider implementing this.

nesterscript commented 1 year ago

I am working on an extension that ignores irrelevant changes (like whitespaces outside of strings) based on the grammar rules of the programming language. The number of supported languages is quite small so far, but maybe it is useful to some of you.

Hmm. Very interesting. Thank you! Will check now. P.S. ignore whitespace in VSCode needed anyways.

FH-Inway commented 1 year ago

+1 for the option to ignore all white space.

Iaotle commented 1 year ago

@hediet you self-assigned this a long time ago, are you working on this?

surfmuggle commented 1 year ago

@tobiasdiez i created a feature request to ignore line breaks in diff editor see #198381

nessadc commented 1 year ago

This is really needed please.

steen16 commented 1 year ago

Seriously :) 5 years and counting...

HFTrader commented 11 months ago

Not implementing this feature is UNCHRISTIAN