Giter Club home page Giter Club logo

Comments (6)

freddydk avatar freddydk commented on June 10, 2024 1

I am totally aware that PowerShell 7 can read jsonc - but BcContainerHelper and AL-Go need to be compatible.
To be completely honest, I have much more important things to spend my time on than trying to support comments in app.json.
If people can select pwsh as shell in AL-Go and make it work - they are welcome, but next thing is they will create an issue that we remove comments when we update the json file - any one of those will be resolved as won't fix.

from al-go.

freddydk avatar freddydk commented on June 10, 2024

Wouldn't this be something to fix in the AL Language extension instead?
I assume the settings you are referring to here is the code-workspace file - or?

from al-go.

rdebath avatar rdebath commented on June 10, 2024

Yes, it would, but they refused.
See microsoft/AL#5315 and microsoft/AL#6909
They're using a Json-404 loader just for app.json and doing a poor job of actually surfacing the errors.
The most recent error was the AL-Extension just hanging when loading the workspace; I expect more "issues" until they change their mind.

I usually put this in the settings.json in the .vscode directory of the project.

from al-go.

freddydk avatar freddydk commented on June 10, 2024

In the latest AL Language Extension - they now supports comments in app.json.
Problem is, that this breaks every devops solution out there.
PowerShell doesn't support loading json with comments - and certainly not when re-writing app.json after updating version numbers.

from al-go.

freddydk avatar freddydk commented on June 10, 2024

I have requested that they revert that and instead force json.

from al-go.

rdebath avatar rdebath commented on June 10, 2024

Ah, so that'd be a good reason for them to use Json-404. But as it seems they just switched it to Json5 that's obviously not the reason they didn't change it before.

However, I suspect you need to make it clear that it needs an AL0999 message to warn about the external tools issue rather than a simple revert of the Json5 change as this issue is that VScode will be setup by users to treat .json files as jsonc and so cause this breakage without any errors in vscode.

The reasons for making the config file allow comments still apply IMO so a revert isn't the correct solution for that reason too.

Also you're wrong about powershell not loading jsonc, while you're correct about PS5.1, the PS6/7 versions will read files with comments, though a rewrite will still remove the comments and rewrite it using a dumbed down (dare I say ugly) "prettified" format.

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/convertfrom-json?view=powershell-7.4

Beginning with PowerShell 6, the cmdlet supports JSON with comments. JSON comments start with two forward slashes (//) characters. JSON comments aren't captured in the objects output by the cmdlet. Prior to PowerShell 6, ConvertFrom-Json would return an error when it encountered a JSON comment.

from al-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.