vscode-compare-folders
vscode-compare-folders copied to clipboard
The source code of the extension CompareFolders
The extension allows you to compare folders, show the diffs in a list and present diff in a splitted view side by side.
Thanks
The extension uses the great dir-compare
package made by Liviu Grigorescu. If you like this extension, please give a star to dir-compare
!
Limitations
Currently seems like there might be issues [#81, #83] with comparing local and remote folders over ssh. Please take this under consideration.
How to use?
There are several ways to choose folders to compare:
- Command Palette -
-
Compare a folder against workspace
choose a folder to compare against the workspace's folder (when workspace is not empty) -
Choose 2 folders and compare
- opens OS folder chooser twice
-
- Compare Folders Panel (Click on the icon in the Activity Bar)
-
Click to select a folder
see 1st item -
Click to select folders
see 2nd item
-
- File explorer
- Select 2 folders, right click and click on
Compare selected folders
see 2nd item
- Select 2 folders, right click and click on
- From history
-
Pick from recent compares
chose one of the pairs you compared in the past. - (The list can be reset by
Clear recent compares
)
-
Refresh
- If there are changes in the compared folders' files, click on the refresh
button will re-compare the folders.
Options (under vscode settings)
-
excludeFilter
- glob string -
includeFilter
- glob string
Example
"compareFolders.excludeFilter": [
"**/node_modules",
"**/.svn",
"**/.git"
]
-
compareContent
- boolean - Compares files by content -
diffViewTitle
- One of the options: "name only", "compared path", "full path" -
ignoreFileNameCase
- boolean - Compare files with the same name but different case -
diffLayout
- One of the options: "local <> compared" or "compared <> local" -
showIdentical
- boolean - Whether or not show the identical files panel -
useDiffMerge
- boolean - Whether or not usingDiff & Merge
extension as the Diff viewer. In order to use this option, you should install the extension -
folderLeft
+folderRight
- strings - paths of 2 folders, compare them on the extension load. -
ignoreExtension
- Set groups of extensions so while comparing, pairs of files considered the same file if both of the files extension are in the same group. Note: each extension can show only once it this list -
ignoreLineEnding
- boolean - ignore crlf/lf line ending differences -
ignoreWhiteSpaces
- boolean - ignore white spaces at the beginning and ending of a line (similar todiff -b
) -
ignoreAllWhiteSpaces
- boolean - ignore all white space differences (similar todiff -w
) -
ignoreEmptyLines
- boolean - ignore differences caused by empty lines (similar todiff -B
)
Example
"compareFolders.ignoreExtension": [
["php", "cs"]
]
CLI
By calling the following command from the terminal / command line, the extension will be calling on vscode load and show the differences view
COMPARE_FOLDERS=DIFF code path/to/folder1 path/to/folder2
Read more about the development process
You can find the series of the posts about how this extension developed step by step in medium.com.
Contributors
llgcode
|
Like the extension?
Show your love
Isn't working as expected?
Please create an issue
Changelog
You can find it here
Credits
Activity bar's icon (and more) by Stockio.com Null icon made from Icon Fonts is licensed by CC BY 3.0 External link icon made by Dave Gandy from www.flaticon.com