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

Filenames don't strip whitespaces in affixes #281

Closed cegekaJG closed 1 year ago

cegekaJG commented 1 year ago

When renaming a file, all whitespaces in the object name will be filtered out, with the exception of whitespaces in the affixes. This is an issue because with that whitespace, the file violates AA0215. However, without a whitespace in the affix, object names become hard to read.

For example: Assuming a table object called Vehicle and a prefix called BCE, the new object name would become BCEVehicle, and the filename would be BCEVehicle.Tab.al. But if the prefix were BCE, the new names would be BCE Vehicle and BCE Vehicle.Tab.al, respectively.

I'm a bit confused because in your blog you also have a whitespace in your prefix. img

waldo1001 commented 1 year ago

Now I am confused - because on my end, it does strip the spaces.. 🤔.

Can you share all your CRS settings?

cegekaJG commented 1 year ago

I figured it out - I originally included the <Prefix> tag in the name template because I had RemovePrefixfromFilename enabled. That one doesn't strip the whitespace. Here are my new settings:

"CRS.ExtensionObjectNamePattern": "<Prefix><BaseName>",
"CRS.FileNamePattern": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
"CRS.FileNamePatternExtensions": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
"CRS.FileNamePatternPageCustomizations": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
"CRS.ObjectNamePrefix": "DUR ",
"CRS.ObjectNameSuffix": "",
"CRS.RenameWithGit": false