Skip to content
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

Upgrade to Swift 5! #464

Merged
merged 4 commits into from
May 5, 2019
Merged

Upgrade to Swift 5! #464

merged 4 commits into from
May 5, 2019

Conversation

jeremywiebe
Copy link
Contributor

@jeremywiebe jeremywiebe commented May 4, 2019

Summary

This PR upgrades the codebase to Swift 5. It will require compiling with Xcode 10.2.

The most significant change is the raw byte handling in RPCSending.swift so please review that closely... I think I've gotten it right with hopefully similar performance!

Related Issues

Related to #463

Example: Closes #461

Checklist

  • All code compiles without warnings
  • All unit tests pass

Review Checklist

  • I have responded to reviews and made changes where appropriate.
  • I have tested the code
  • I have updated comments / documentation related to the changes I made.
  • I have rebased my PR branch onto xi-mac/master.

Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks for this! One little Q mostly just for my own curiosity, but looks good.

@@ -543,6 +543,9 @@ extension EditViewController {

case .hideReplaceInterface:
Swift.print("hideReplaceInterface not implemented")

@unknown default:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this syntax? Can you link me a reference?

Copy link
Contributor Author

@jeremywiebe jeremywiebe May 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just learned about it while upgrading also. It allows us to have an exhaustive enum with a default case to protect against future additions to the enum. If we don't put the @unknown on the default, the compiler will complain that we've covered all the cases already.

https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md#unknown

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, thanks!

@jeremywiebe jeremywiebe merged commit d4ecbca into xi-editor:master May 5, 2019
@jeremywiebe jeremywiebe deleted the swift-5.0 branch May 6, 2019 04:30
@cmyr cmyr mentioned this pull request May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update to swift 5
2 participants