This post is specifically about how you can write your own refactoring (and contribute them back to the Swift compiler if you choose to do so).
The nice thing about Swift being open-source and Xcode supporting multiple Toolchains is you can test your own modifications to the language, refactorings, etc. Xcode will syntax highlight your language changes and provide access to your refactorings.
It is also a great way to test out other people's proposed changes to the language: pull their branch (or download their toolchain archive) and give it a try. As implementations for proposed Swift 5 changes start to become available you can test them in real situations and provide informed feedback.
As with any code, be careful about downloading from untrusted sources!