Open simonl65 opened 6 years ago
It's been over a year and I REALLY would love to have this feature. Any chance it will be implemented?
try to install Beyond Compare. It makes possible to configure diffs in any way. Also sourcetree can help you to configure Beyond Comare. In vs you will see something like
It would be also good if differences in line breaks (not just new/deleted empty lines) could be ignored. That is, the following should be taken to be the same:
aaaa
bbb
aaaabbb
Ability to Ignore whitespace in Visual Studio Code git diff view for sure will be good feature
Looking forward for that
This would be really helpful!
As with everything, I have Thoughts On This.
I suspect that opinionated formatters such as Prettier solve one problem but at high cost.
The problem that formatters solve: whitespace and indentation is consistent across developers and time, so that changes between commits are obvious. This reduces errors and cognitive load when reviewing code and when troubleshooting.
Two problems that they aggravate: 1) Expressiveness and facility is important when coding and reading code, and I would argue this is top priority. Opinionated formatters impose a cognitive load on everyone, making individual coders work harder to read their own code 2) Moreover, this raises the bar for entry for new people, making coding a less inclusive industry
A better solution, in my opinion: Do away with whitespace as a concern when writing or reviewing code. Do not impose whitespace and indentation formatting constraints for source code if the language itself does not. Each developer can then individually format code according to how each thinks best.
This is why I support this feature request.
As an industry could stand to move away from having opinions about how other developers format their source code, in favor of expressiveness, ease and inclusiveness.
Hi @rendall, thanks for your comment. While well written, it doesn't seem to add any new specifications or refinements to the feature request. While we all would like this feature to ship, we should respect the time of the maintainers and, as per the contributing guidelines, avoid making comments that simply express a desire for something to be done. If we are not willing to add the feature ourselves and submit a pull request, we must wait and trust in the prioritisation system this team has developed to help bring us this free product we all enjoy.
Hi Mr. Robinson. Sincerely sorry my opinion rubbed you the wrong way.
While I don't mind, the code of conduct emphasizes friendliness and patience. Is there another way you can give feedback?
Cheers!
I do apologise, I have updated my comment to be less caustic. Incidentally, I use non-binary pronouns. Thank you for your understanding.
Gladly. In case we ever interact again, feel free to share your preferred honorific
This would be really helpful even three years later!
This would be really helpful even three years later!
@soundneedle, @farmerpaul, @samuelms1, @navneeth-spotnana, @WilliamLHarms This feature already exists in VS code for long now
By default now it is enabled to ignore whitespace. If not you can check click on this button to disable "Show Whitespace":
You can notice if I enable setting "Show Whitespace", it is showing all whitespace changes too.
@pranavq212 Thanks! I was just searching for an hour about this.
@soundneedle, @farmerpaul, @samuelms1, @navneeth-spotnana, @WilliamLHarms This feature already exists in VS code for long now
By default now it is enabled to ignore whitespace. If not you can check click on this button to disable "Show Whitespace":
You can notice if I enable setting "Show Whitespace", it is showing all whitespace changes too.
That's not quite what people are asking for. It doesn't ignore all whitespace. It ignores leading or trailing whitespace only.
Just a ping on this, and an example of formatting changes we'd like to be able turn off and not show in the diff editor (like -w for git diff as someone mentioned previously):
This is an essential feature. I am currently looking for a breaking change in a git repo that also had uniform formatling applied in between the commits of interest, and this is obnoxiously in the way if using gitlens.
I am longing for the venerable TortoiseDiff winding back to earlier this century:
Any progress on ignoring all spaces? The below code is exactly the same - there should be a way to not show it as a diff. Thx!
this is an essential feature, especially when working with libraries from github.
This is an example of how the spaces in between are ignored in TortoiseGit:
We have this same problem in Azure DevOps diffing during pull requests too.. it's like a fundamental issue with they way Microsoft seems to do diffing with their dev tools :(
Seem to be already solved. see https://code.visualstudio.com/updates/v1_20#_toggle-for-ignore-trim-whitespace-in-the-diff-editor
@hcoona Does that ignore all whitespace or just leading and/or trailing whitespace. If the latter, please re-read the original description of this ticket.
This is Not solved. This update will ignore leading and trailing whitespace. But, It does Not ignore ALL whitespace changes. For example: This is a test line This is a test line In the above example the diff editor will flag the difference on both sides of the 'a' in the top line, even though, the lines are functionally the same.
On Mon, Dec 27, 2021 at 8:57 PM Shuai Zhang @.***> wrote:
Seem to be already solved. see https://code.visualstudio.com/updates/v1_20#_toggle-for-ignore-trim-whitespace-in-the-diff-editor
— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/43026#issuecomment-1001842737, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARFVN6DLVY6AEN42HFDL6KLUTERSZANCNFSM4EPLEUUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
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
With regards to resolution, I would suspect that until there is a comment or referenced commit on this issue tracker, I wouldn't consider this resolved. That's assuming common practice of linking commits to issue trackers.
Something people may not realise, I had noticed that the whitespace icon but as it was greyed out, thought it meant it was completely disabled for that type of diff. Imagine my aghast when simply clicking the icon, enabled MORE whitespace differences than before (all of which occurred simply because I saved a file whilst having auto-formtiting enabled). Clicking the whitespace icon again, hide those with just leading/trailing whitespace issues.
As mentioned by others though, the "internal/unimportant" whitespace (as some people designate it) still shows up because of these auto-formatter changes and I haven't found a way to make Visual Studio play nicely on that whilst waiting on a built-in option to be implemented.
I have wondered if both options should probably be determined by type of file? The way I would see it, have a global option, then override by file extension as there are some files where different spaces mean everything (yaml and python are two I can recall would like have that issue right now).
no solution for this one yet?
I think the ideal solution for everyone is to avoid diffing any non-functional whitespace, which would have to be language specific. This could potentially be done by comparing generated ASTs with an appropriately forgiving parser. However, a diff that could show whitespace changes in strings and ignore everything else would get 90% of the way there.
In my own custom implementation of a solution I needed, I ran into the string problem as well as challenges around multiple newline differences and the location of spaces separating tokens. It quickly became clear that a robust solution really needs to be more syntax aware. Not all whitespace can be ignored to correctly ignore whitespace changes.
Mate I just want VSCode to use git diff -w
, language specific ASTs seems a bit extra to me
Let not the perfect be the enemy of the good.
A diff that could show whitespace changes in strings and ignore everything else would get me 100% there. I use this feature every time I save a file. Prob (50 - 70 times a day) This fix could probably save me 30 mins a day, and even more importantly, avoid conflicts in code.
On Fri, Jan 28, 2022 at 9:10 PM Justin Warkentin @.***> wrote:
I think the ideal solution for everyone is to avoid diffing any non-functional whitespace, which would have to be language specific. This could potentially be done by comparing generated ASTs with an appropriately forgiving parser. However, a diff that could show whitespace changes in strings and ignore everything else would get 90% of the way there.
In my own custom implementation of a solution I needed, I ran into the string problem as well as challenges around multiple newline differences and the location of spaces separating tokens. It quickly became clear that a robust solution really needs to be more syntax aware. Not all whitespace can be ignored to correctly ignore whitespace changes.
— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/43026#issuecomment-1024819217, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARFVN6E3YR2X7TIDYODTQHTUYNLBJANCNFSM4EPLEUUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
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
Would really love this feature!
BTW, is there anyway I can make VSCode ignore empty line additions/deletions?
I want vscode to ignore the following difference:
4 years later... Why is this so hard? It's a basic fundamental feature.
Has anyone found a good extension that can do it? Your favorite?
just hit this issue after 4 years later and happy to join the big long team :)
+1 for this feature, hope it turns up eventually!
+1 for this, it's driving me mad to look through 300 changes in a file only to find out there are 2 non-whitespace changes and the developer did a "pretty format" resulting in azure devops treating this as a huge change.....
+1 for this, working on the task to format the code on submitting, space change shouldn't bother the engineer on the code compare.
Is this something we could swarm on and get done in a pull request?
On Wed, Aug 11, 2021 at 2:02 PM gm-lunatix @.***> wrote:
Just a ping on this, and an example of formatting changes we'd like to be able turn off and not show in the diff editor (like -w for git diff as someone mentioned previously):
[image: image] https://user-images.githubusercontent.com/73477545/129086851-142e9cdf-bac4-4198-8d0b-1352d6b378ad.png
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/43026#issuecomment-897075412, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARFVN6CREQLXGSDBBQ3OC4TT4LCMXANCNFSM4EPLEUUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .
-- 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
+1 for this
+1
+1
GitHub has this feature and it works really well where you can ignore all whitespace differences. I was directed here because ADO does not have this functionality and apparently it needs to be implemented in VSCode to be available on ADO. Considering many microsoft engineers that use ADO, I'd argue it's in Microsoft's self interest to fix this. Even if it saves just one minute of time per day per engineer for 10,000 engineers, that adds up to the equivalent of 20 full time engineers per year looking at lines with only whitespace changes. The time invested in this would very quickly pay for itself and provide a huge return on investment.
Bump, please implement this
+1
On Mon, May 30, 2022 at 9:29 AM Prateek @.***> wrote:
Bump, please implement this
— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/43026#issuecomment-1141224185, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARFVN6D3HBG66L3ZTIT6C5DVMTGEDANCNFSM4EPLEUUA . 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
I found a workaround meanwhile, you could download gitk
on your computer and open it in your working directory where .git is placed, and it has an option to ignore all whitespaces.
+1
This feature would really help
+1
+1 for this
4 years and 5 months....
I've loved the convenience of having instant diffs in VSCode.
Until, someone on the team used an auto-formatter (which should be no problem), but suddenly I can't review the real code changes among the hundreds of places where something like (1,2) got changed to (1, 2) and I have to spend an hour searching for the obvious expected "ignore ALL whitespace" setting... then realize it actually doesn't exist. (yet) Then I have to go on a research quest to find extensions to fix the problem, and create a new policy for everyone that auto-formatter now must be run at checkpoint times to minimize the risk of unreadable diffs.
I'm sure a lot more people are getting burned by this (and making policy changes to work around it) than just the few who bother to comment here. Surely we don't want people to have to leave the smooth flow of using VSCode to view everyday diffs with some other tool?
I think the diff in VSCode has been great except for this one very strange shortcoming.
(Review quality is safety critical in some fields (like control systems) and good diffs are a tremendous help. I previously had an editor that I liked, except the diff was inadequate. The way I learned about VSCode in the first place was I was searching for a more readable diff tool and someone recommended it. That led to me using it as my main editor.)
Thanks for keeping this issue open; please consider it very valuable. (Is there a way to escalate issues to a Microsoft product team, so it doesn't have to wait for an open source volunteer to fix it?)
since there seems to be no feedback for VS code , can someone suggest other tool for visual diff that does ignore white space ?
since there seems to be no feedback for VS code , can someone suggest other tool for visual diff that does ignore white space ?
If you use GitHub (also a Microsoft product, so feature parity would be nice), you can append ?w=1 (or &w=1) to the end of the diff page URL. (Source: https://stackoverflow.com/a/37145215/175290)
Steps to Reproduce:
"diffEditor.ignoreTrimWhitespace": true
Would it be possible to add
"diffEditor.ignoreAllSpaces": true
? I believe the command-line to achieve this would be something likegit diff --ignore-space-at-eol -b -w [commit]...
h/t Daniel Gomez @ coderwall
[edit] Might only need
-w
? [/edit]