vDiff - A Diff for Versioned MethodsvDiff generates a diff of a file's versioned methods. To perserve legacy code, we may implement a change to hello01() by copying it and adding the change in a new method hello02(). Now we won't introduce any bugs in legacy, but we won't be able to easily see the change in the source control's diff. However, vDiff will comb through a file and create a diff between the two methods. How to use
Customizing your signatureCurrently the signature pattern should consist of two capture groups. The first capture group is expected to be the method's identifier. This is what matches two different versions together. The second is the version.
Extracting your version
Version TypeSetting your version type (and versionDateFormat if the type is date) is very important as it orders the methods determining which one is new and old. The default value is text.
Comparing between files
Using RegexRegex is a sequence of characters that specifies a search pattern in text. It is used heavily in this extension to find versioned methods and to extract information about them. If you are new to regex, I would recommend using a regex testing website like https://regex101.com/ to test if your regex matches your methods' signatures when configuring your settings. Here is also a cheat sheet: https://quickref.me/regex#regex-in-javascript The regex expression in your settings should be for javascript regex. Not the language you are trying to parse. The regex in the settings comes in as a string, so the proper escape characters must be included. That is why in the examples you will see "\d" instead of "\d". SettingsMethod PatternsMethod patterns are the regex or string templates for parsing versioned methods Here is the configuration for the example gif
You can add more method patterns to support other file types or version configurations |