vscode
vscode copied to clipboard
Suggestion: collapse unchanged regions in diff
When viewing a diff (2 pane or inline) it would be useful to collapse the unchanged lines. This helps focus in on just the changes, especially when the changes are few an spread out.
any update on this one? Very rough transition from text-based git to VSCode because of this feature lacking.
bump...
This would be very nice to see. Right now, with big files I'm opening Vim (with fugitive plugin) in the terminal to clean up the diffs
This is something I can't live without, the collapsing along with the inline Stage/Discard buttons makes it so much easier to keep commits tidy:
This screenshot is from GitX — still by far my favorite Git UI. I have tried literally all the extensions in VS Code, but none comes even close. I think this is something the core editor has to provide.
no update on this issue? any one knows any extension?
this issue is open since 2016
VS Code could really stand to make some huge improvements by looking at Atom's git support -- viewing diffs, walking through changes & staging them, as well as undo/reset ... it really is quite a bummer that these features are lacking.
Yeah. To hide unchanged context is a very common feature for all diff editor and I think the MS developers also need this feature for each commit. I wonder why they abandoned the implementation for such a long time.
VSCode has built-in collapse/expand feature for code editor. A different algorithm would make the deal it seems.
four year..... the function is still missing.
This is, by far, my most wanted feature. It is standard in many other tools, specially when doing source control diffs.
I'd appreciate some comment from the team as to why is not being considered. Is it too hard to implement?
The only reason I'm still using GitHub Desktop is because of this missing functionality. I'm often working on large files of C/C++ with 1000s of lines of code and long scrolls are just killing me.
Please make sure that the "selecting ranges to Stage" feature won't break!
related to #87944
This is one of the main things Magit gives me and Magit is the only reason I use Emacs anymore, please add this feature.
i know i'm not supposed to comment just to 👍 but here i am commenting simply to 👍 anyone know of a plugin to do this instead?
@jakedowns Try using the "vscode-diff" extension. It doesn't solve the problem in this issue. However it generates and opens the output of git diff
in VS Code.
Do note that if you're on Windows, you need to modify the JS file of the extension to fix the problem described in huytd/vscode-diff#1
And if you want a nicer view, you can add the "Diff Viewer" extension. You'll have to make the same change above (to "vscode-diff" regardless of environment) to change to the diff
extension. Then right-click the editor tab and click Reopen Editor With... to choose Diff Editor.
It is a shame that git diff
provides better overview of changes than VS Code. 👎🏻
Maybe this is waiting for community contributions. Is this the right file?
https://github.com/microsoft/vscode/blob/main/src/vs/editor/browser/widget/diffEditorWidget.ts
It is a shame that
git diff
provides better overview of changes than VS Code. 👎🏻
Not just git diff. Github itself, Bitbucket, Beyond Compare, pretty much all code diff tools do this.
I left VS Code for WebStorm a few years ago. I thought I might come back, but I keep bumping into things like this.
Hi @archon810 nice bumping in to you 😁
Agree, for now I just use the "jump to next change" button to work around this, but the current diff viewer makes for a cluttered experience.
Cluttered and a little stressful, because I never feel 100% sure I've seen everything.
this would definitely be a much needed feature
Something similar to Intellij diff as shown bellow:
Please..? I've tried to get used to this, but with collapsed regions the UX is just much better. I keep going back to Sourcetree just because of this.
The problem is that the folding does not even work inside a diff file. In my case I would like to get a screenshot for a small diff, the diffs are in the same file, but in different far locations, so it's not possible to fold irrelevant code, or to have some option to show only the diffs as in other tools.
This is currently the only reason why I got some trouble to move from Atom to VS Code :( It would be awesome to have this feature implemented !
@thomashbrnrd I just use another tool for diff. VSCode is better than Atom so this one thing shouldn't stop you.
(Also I believe Atom is retired.)
@ADTC Yes Atom is retired, but Atom was really better than VS Code on the versioning / git side. This feature that we request here was implemented long time ago in Atom ...
May I ask what tool you are using for the git diff and stage / commit only some parts of a file ?
@thomashbrnrd I prefer to use Git in terminal command line (external) and visually in another tool. In VS Code I use some Git related extensions but only to get information about the current history.
If you're on Windows, you can try Git Extensions. It's very good and can do line by line staging. It's also possible to use it on Mac with some strange emulation but I didn't want that so I switched to Fork on my new Mac.
@thomashbrnrd If you're comfortable with text mode tools, you could use interactive add (git add -i
).
If you prefer GUI and you're fine with the tool not being exceptionally pretty, I'd recommend the official git-gui
, which comes out of the box with Git on some platforms (on many Linux distros you'd have to manually install the corresponding package, typically, git-gui
). It's what I use and it works reasonably well.
It really does suck that it has taken so long for VSCode to still have no support for hiding/collapsing unchanged diff regions. Evidently, garbage like "custom Explorer autoreveal logic", "hide Activity bar and Panel badges" or "new font setting for OpenType fonts" is more essential to the development workflow for some; since this issue was opened almost 7 years ago there have been tens of releases with hundreds of superfluous insignificant features like those. :disappointed:
I use Winmerge to compare. It can show only differences (set context to 0). Beyond Compare should also have this essential feature.
Edit: Notepad++ also has this feature with comparePlus plugin
https://github.com/pnedev/comparePlus
How is it possible that this hasn't been done in 6 years! Much needed feature to be competitive with, e.g., PyCharm. Please have a go at implementing it :pray: Thanks!