-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Implement SE-0039 (Modernizing Playground Literals) #2215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
// FIXME: It feels like a layering violation to mention the protocol | ||
// kind and description here, but essentially there is a single | ||
// delcarative way to specify the shape of object literals, their |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo "declarative".
I think this approach is reasonable, no need for the FIXME.
Aside from the one comment typo, the patch looks great! Question though: what is the migration plan for this? This isn't producing fixits from the old to new syntax, and we want to make sure that playgrounds which use these get moved forward. It is probably worth it to keep the lexer/parser support for the old syntax in just to provide support to move to the new syntax. |
I was thinking about the migration plan as well, and that we should have fix-its. I agree keeping the old parser support --- or reworking it for that use case --- makes that possible. |
For example, parse "#Image(imageLiteral:...)" and provide a FixIt to change it to "#imageLiteral(resourceName:...)". Now we see something like: test.swift:4:9: error: '#Image' has been renamed to '#imageLiteral var y = #Image(imageLiteral: "image.jpg") ^~~~~~ ~~~~~~~~~~~~ #imageLiteral resourceName Handling the old syntax, and providing a FixIt for that, will be handled in a separate commit. Needs tests. Will be provided in later commit once full parsing support is done.
... and provide fixits to new syntax. Full tests to come in later commit.
@akyrtzi told me this should be fine.
@swift-ci test |
@swift-ci test |
@swift-ci test |
Implements SE-0039 (Modernizing Playground Literals).