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

First draft for Support of multiple Prefixes #254

Closed pri-kise closed 1 year ago

pri-kise commented 2 years ago

This is a first draft to support multiple prefixes.

Right now I added the feature only for table extensions fields. But this can easily added for the other extension objects.

I was tryin to create a solution for issue: https://github.com/waldo1001/crs-al-language-extension/issues/151

It's not perfect, but I could work as temporary solution.

@waldo1001 do you have any plans and time to work on improvements of prefix handling or would accept the solution that is proposed with this Pull Request.

@christianbraeunlich you do seem to have some experience with npm. Do you know how I can disable that the yarn.lock is updated and that yarn.lock is used instead of package-lock.json for this repository?

christianbraeunlich commented 2 years ago

Did you try this: https://github.com/waldo1001/crs-al-language-extension/blob/master/HowToContribute.md#installation---with-yarn

pri-kise commented 1 year ago

@waldo1001 I would really appreciate if you give me some feedback on this pullrequest. Is this a feature you would accept? I know i would have to add this feature to any function where currently the ObjectNamePrefix is used.

This PR is related to the issue https://github.com/waldo1001/crs-al-language-extension/issues/263. I know it might be better to check the Name for the mandatory-affixes, but I don't know how to properly read a value of the AppSourceCop.json

waldo1001 commented 1 year ago

First of all: thank you! and sorry to not being able to really look into this myself (too busy).

Having multiple places for similar settings doesn't make sense .. we should go for the "appsourcecop.json" approach.
That should be quite similar to my function to read the app.json (in the Settings.ts file): image

If I'm not mistaken, the idea is to check the current name with the approved affixes, and if one of the affixes are either in the beginning, or at the end - then the filename is accepted .. correct?

pri-kise commented 1 year ago

My focus was more regarding field Names in Table Extensions or Columns in Report Extensions. If any Affix provided in the AppSoucrCop.Json is available in the Name, then no Prefix or Suffix should be added to the Field or Colum Name.

waldo1001 commented 1 year ago

Makes totally sense.

Do know that multiple affixes is not possible anymore for partners - just old partners (like us?) might have multiple.. .

We simply switch off auto-suffixing because of this and let the codecop handle it :(. But sure - let's see what you can come up with ;-)

pri-kise commented 1 year ago

@waldo1001 it took some time, but now I updated my code to make use of the AppSourceCop.json

Looking forward to feedback.