microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
722 stars 242 forks source link

Mandatory affix required despite using namespaces (AS0011 and AS0054) #7675

Closed tgdoat44 closed 4 months ago

tgdoat44 commented 4 months ago

1. Describe the bug I've been adding namespaces to all my projects and wanted to remove the now unnecessary affixes from the object names. The namespace is now sufficient to identify the objects uniquely.

However, I am still receiving errors that I have to define and use mandatory affixes. If I remove the affix tags from the AppSourceCop.json, I receive AS0054 "The AppSourceCop configuration must specify one of the following properties: 'mandatorySuffix', 'mandatoryPrefix', or 'mandatoryAffixes'".

As soon as I define "mandatoryAffixes" in AppSourceCop.json, I receive the subsequent error, that my objects have to use a mandatory affix (Code AS0011 "The identifier 'This is a test' must have at least one of the mandatory affixes 'AFFIX'.").

2. To Reproduce I have tested this in a clean project (AL: Go!) with following settings:

3. Expected behavior The idea of namespaces is to replace the need for the affixes. When using namespaces, the affixes should no longer be mandatory and creating objects without affixes has to be possible without errors from the code cops.

4. Actual behavior The errors AS0011 and AS0054 were thrown. Objects could not be defined without an affix even though the namespace was used.

5. Versions:

BazookaMusic commented 4 months ago

Unfortunately, this is by design. There are still cases that namespaces do not cover properly. For example, you can add fields via a table extension and somehow it has to be ensured that these fields will not collide with base app/other publisher's fields.

Due to this and other issues, we haven't removed the requirement for affixes in this release.

The current design of the namespaces is the first step towards moving away from affixes, but unfortunately, they are still required.