waldo1001 / crs-al-language-extension

Make working with the (Dynamics NAV / 365) AL Language easier and more efficient.
MIT License
34 stars 42 forks source link

Add customizable subfolder paths with placeholder support #300

Open cegekaJG opened 4 months ago

cegekaJG commented 4 months ago

This PR adds the property "FolderPathPattern" to the extension's settings and expands the functionality of the "Reorganize" function. The new property allows users to define a custom subfolder path using the same placeholders used for object and file names. It also adds some new placeholders such as <AlSubFolder> to ensure the default value retains the same behavior as before. Finally, it reorganizes the pattern matching code to remove some duplicate code by reusing functions.

This PR addresses https://github.com/waldo1001/crs-al-language-extension/issues/297.

waldo1001 commented 1 month ago

I just noticed this, sorry. First - thanks so much for taking the time! Second - it's one of the biggest PRs I ever got - and since I'm totally not using the "reorganize" feature myself, I'm not sure about this.

How do you see the impact? Do we risk breaking changes?

cegekaJG commented 1 month ago

It's been a while, but I've tested a few scenarios, especially to ensure the new settings wouldn't break old configurations. Behavior will only deviate when using the new template property, and I am reusing the same S/R logic as the one for the filenames, so it should be stable. There is one new placeholder that can also be used for filenames, so technically it is possible to introduce a breaking change if a repository is using the exact string of the new placeholder explicitly, but that's very unlikely.