The only complaint I have (devs are nitpicky), besides having to save the files first, is that the red/green color scheme can be misleading. You'll get a typical side-by-side comparison showing the differences in the files. ![]() Once you've got the files, just select them both in the "Explorer" pane and then choose "Compare Selected". There's probably a VS Code extension to help format nearly any file type though, so format it into something manageable if you need to. ![]() If your files are minified, as mine were, the VS Code comparison will be as helpful as GitHub. If you already have the files to compare, awesome - otherwise, paste the contents of whatever you want to compare into those empty files. I just created a temp folder to work out of, and added a couple empty files to it. Unfortunately, VS Code won't compare two files that are opened in the editor but aren't actually saved somewhere. Now let's see how VS Code can help out.Įither create a folder, or open one if you already have some files on disk to compare. I wanted to share why I was even looking for a quick way to compare a couple files, and there you have it. On the other hand, a properly formatted file makes it trivial to find the change, but that's not always an option. I made a tiny change to the minified report file, but can you see it? It is visible below. To show you what I mean, here's a sample MS report file from Anthony Duguid, minified with Josh Johnson's XML Tools extension for VS Code, and then pushed to GitHub. I have yet to see a VCS that helps much with that. Usually I'd do that using the UI for the VCS right in the browser, but this particular XML file also happens to be generated by a tool that minifies the XML down to a single line. On the context menu, you can set this setting as follows: "partialDiff.Anyway, I found myself needing to grab a couple versions of the file in question and quickly compare them to see where things went wrong. Unlisted commands will still appear.įor example, if you don't want to see Compare Text in Visible Editors command (Command ID: ) mandsOnContextMenu (default:, all commands visible)Ĭommands appear on the context menu. Executing Select Text for Compare, Compare Text with Previous Selection or Compare Text in Visible Editors command without selecting any text will use the entire text of the current file.A diff will be shown only after selecting comparison text first (using Select Text for Compare) except Compare Text in Visible Editors.Toggle pre-comparison text normalization rules. Toggle Pre-Comparison Text Normalization Rules ( Command ID: ) ![]() Marks the selected text as the text to compare the next selection with.Ĭompare Text with Previous Selection ( Command ID: 2AndTakeDiff)Ĭompares the selected text to the first selection.Ĭompare Text with Clipboard ( Command ID: )Ĭompares the current clipboard to the selected text.Ĭompare Text in Visible Editors ( Command ID: ) Also screenshots (or even videos) are often very very helpful! Reporting a bug: Please include environment information (OS name/version, the editor version).I can't think of introducing it until I understand how it helps you □ Such as, in what situation the feature could help you and how, or how the lack of the feature is causing an inconvenience to you. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |