Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Potential stability issue #9

Open
anreitersimon opened this issue Mar 23, 2018 · 0 comments
Open

Potential stability issue #9

anreitersimon opened this issue Mar 23, 2018 · 0 comments
Labels
Swift Nightly Breakage We need to wait for Swift 4.2 to stabelize

Comments

@anreitersimon
Copy link

I have tried to run prettier on on our codebase and was not able to do so successfully.

The kind of errors were pretty similar to those mentioned in here.
After some searching around i stumbled upon this bug report, which seemed to explain the issues i was having.

In the comment section a libSyntax contributor stated:

I intentionally introduced null to represent missing node as a part of performance optimization.
For instance, every IdentifierExpr have optional DeclNameArguments (e.g. (x:y:)) node. Allocating it for every identifier expressions is definitely a waste of time and resource.

please do not use JSON representation, RawSyntax or SyntaxData directly. They are really implementation detail.

From what i could gather prettier uses swiftc -frontend -emit-syntax under the hood to obtain the JSON representation and then processes it.

Since this is not a officially supported API this might cause some problems down the road.

I thaught i should bring it up since its definitely something to be aware of.

Best regards,

Simon

@mrcljx mrcljx added the Swift Nightly Breakage We need to wait for Swift 4.2 to stabelize label May 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Swift Nightly Breakage We need to wait for Swift 4.2 to stabelize
Projects
None yet
Development

No branches or pull requests

2 participants