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

Problem with "CRS.ExtensionObjectNamePattern" #288

Open Mic-AL opened 1 year ago

Mic-AL commented 1 year ago

For some reason my "CRS.FileNamePatternExtensions" is not working.

My settings.json file contains the following

"CRS.ObjectNameSuffix": "_NMH",
"CRS.ExtensionObjectNamePattern": "<ObjectNameShort> <ObjectTypeShortPascalCase>",
"CRS.FileNamePattern": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
"CRS.FileNamePatternExtensions": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
"CRS.FileNamePatternPageCustomizations": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
"CRS.OnSaveAlFileAction": "Rename",
"CRS.RemoveSuffixFromFilename": true,
"CRS.RemoveUnderscoreFromFilename": false,
"CRS.RenameWithGit": false,

The settings file has no errors.

When I save an existing table extensions object the object and file are both renamed.

The object name (manually input): tableextension 61001 "Customer TableExt_NMH" extends Customer is changed to

tableextension 61001 "<ObjectNameShort> TableExt" extends Customer

The filename is also renamed to

"ObjectNameShortTableExtal.TableExt.al".

I am using v. 1.5.28.

If I change ObjectNameShort to BaseNameShort :

    "CRS.ExtensionObjectNamePattern": "<BaseNameShort> <ObjectTypeShortPascalCase>",

in the settings file I get this result

tableextension 61001 "Customer TableExt_NMH" extends Customer

and the filename is set to

CustomerTableExt.TableExt

If I save the same object again the object name changes to

tableextension 61001 "Customer TableExt" extends Customer (suffix is removed)

The filename is still:

CustomerTableExt.TableExt

Is there possibly something that I am not doing correctly?

Mic-AL commented 1 year ago

I think I found the solution/workaround.

I changed the "CRS.ExtensionObjectNamePattern" setting to

"CRS.ExtensionObjectNamePattern": " ",

There appears to be a problem with