waldo1001 / crs-al-language-extension

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

Setting to strip non-alphanumeric characters from pattern-generated extension object names #115

Closed rvanbekkum closed 5 years ago

rvanbekkum commented 5 years ago

Hello @waldo1001,

I think this issue is best explained through an example. Let's say I have the following settings to automatically set the generated extension object name when renaming: example_settings Then, when I would create an extension on page 18 "G/L Account List", I would get the following extension object name from this pattern: current_result

However, the name I would actually like to have based on this extension object name pattern is the following:

pageextension 50100 ABCGLAccountList extends "G/L Account List"

so stripping all non-alphanumeric characters from the suggested extension object name and removing the surrounding quotes.

Is this something you could add as a new setting (e.g., CRS.StripNonAlphanumericCharactersFromObjectNames, see also the AL Code Outline extension that has such a extension) in your extension? A setting that strips all non-alphanumeric characters in extension object names and will then also drop the unnecessary, surrounding quotes.

waldo1001 commented 5 years ago

Makes sense - I will have a look. Thanks!

waldo1001 commented 5 years ago

@rvanbekkum ,

I just realized - did you try the following setting: image

You can find all possible patterns by using the tooltip: image

Does this solve your problem?

rvanbekkum commented 5 years ago

Hi @waldo1001, That seems to give the output that I wanted, thank you for pointing it out. 😄 I have one 'issue' with it though (i.e., always adding quotes), but I decided to leave that as a comment in issue #114, because I think it's more related to that one.