jwikman / nab-al-tools

The code repository for NAB AL Tools, an AL tool for VS Code
https://marketplace.visualstudio.com/items?itemName=nabsolutions.nab-al-tools
MIT License
19 stars 8 forks source link

Create Project : Support conditional placeholder / region placeholders #392

Open fvet opened 2 years ago

fvet commented 2 years ago

Is your feature request related to a problem? Please describe.

Our template contains following boiler plate (app.json)

...
"internalsVisibleTo": [
    {
      "id": "[TEST_APP_ID]",
      "name": "Dynavision [APP_NAME]-Test",
      "publisher": "Dynavision"
    },
    {
      "id": "aea2fd90-9908-4f65-ae7d-03c393401854",
      "name": "Dynavision-Test",
      "publisher": "Dynavision"
    }
...

We are looking for a way (not by cloning the AL project in a 'Simple App Project' and 'Complex App+Test' template) to add a conditional parameter (true/false, e.g. 'Include Test App') to the 'NAB: Create AL Project' so we can remove code based on a condition (similar to #pragma directives, but really remove the code)

Describe the solution you'd like If we would be able to add a region start / end marker in files

#region [placeholdername] #endregion [placeholdername]

[#region [placeholdername]] [#endregion [placeholdername]]

[#NABALTOOLS START [placeholdername]] [#NABALTOOLS END [placeholdername]]

The NAB AL Create Project could test if the [placeholdername] is true or false.

Describe alternatives you've considered

Manually cleaning up all references to test for (proxy / listing) apps that don't really require a test app.

PS: Still looking on how I could use this 'Include Test' app parameter to then remove redundant files as well in a later stage.

jwikman commented 2 years ago

Hi @fvet,

That's an interesting idea. When are you going to start programming TypeScript and help us out with these kind of suggestions? 😜

I need to think about how to solve this in a good way.