Swift Development Environment
The release 2.0 introduces a new tool sourcekite as the interface to sourcekit library.
Given the Swift's ABI is not stable, you need to build this tool if you want to use SDE. Go to sourcekite for further instructions.
TIPS: still given the Swift's ABI is not stable, you may find the hover help or code completion do not show right infos as before after you upgrade the Swift toolchain. This is because the SourceKit library you linked with the sourcekite tool can not understand the sources/binaries of your project. Rebuild your project and restart vscode.
If the release broken your current experience or just you do not like to upgrade but accidently do a upgrade, you could do a qucik downgrade like this:
- download the 1.x vsix from the release page
- remove the installed version in your vscode
- install the local .vsix package in your vscode
History changes can be seen in CHANGELOG.
You can read a hands-on introduction for a detail explanation.
The project focuses on making the below features solid:
- code completion
- error diagnostic
- hover help
- SPM support/preferences/tools
More the big picture could be seen in the wiki
The initial goal of this project is to give myself a joyful Swift coding experience in Linux. But with the help of community, the macOS support is equivalent to that of Linux. Hope it could already drive you to start a joyful coding experience for server side Swift at Linux and macOS.(Or you like to try it on Windows 10 WSL)
The current work of project are done in the free time of the author for his love to swift@linux. So, it is best to make limited resources to focus on the most important functionalities. However, always welcome to provide your ideas.
- Just search "sde" and install from your vscode's Extensions view.
This project only depends on its companion project sourcekite, which only depends on official Swift and its tool project SourceKit library transitively. Go to sourcekite for more infos.
from release 2.0, SDE is considering to base on top of swift 3.1 and vscode 1.8 (typescript 2.0 for development). You will be notified when these version dependencies are broken. (NOTE: Swift 3.1 is intended to be source compatible with Swift 3, so you can develop with SDE and release with 3.0)
The dependence to sourcekitd-repl has been be deprecated in/after release 2.0.
The extension in the marketplace will be rolling-updated in a timed rhythm, such as some weeks. No semantic versioning or backward compatibility guaranteed here. It is better to check the changelog before your update.
Jin Mingjian: twitter
Is it possible to use SDE if I can not build sourcekite in my Linux in that absence of sourcekit library?
Generally we should wait the sourcekit libray to be included in the official download. From 2.0.20170209, SDE makes a sourcekite docker image and adds a new experimental setting "swift.path.sourcekiteDockerMode" for easier adoption for Linux users. Go to sourcekite for more infos.
Why not contribute to the existed projects?
Current such works are all naive to attract linux/backend users to embrace concise and elegant Swift. I am watching the communities of vscode and Swift to provide the best experience at my best. I also highly suggest the work of community(vscode+SwiftLang) should be joint. But I hope we can be in the right way.
How to contribute to this project?
Any feedback contributes its help.
If you are saying about contributions to the sources, this is truely another topic. The experience to use an editor is much different to that of developing for an editor. There may be a little more pain than that you think. But if you like to start, welcome!
There are not too much documents about developing the project. If you have any question or interest, don't hesitate to file a issue(better than a private email). I will help you, then drop more readings gradually. This is the way of "open source".
Why can not debug my executable which built by SPM in my Linux?
Watch this SR for more and then you would be easy to dig out some workaround although there are still other problems.
It seems diagnostic infos are only available after building?
Yes. Not only the diagnostic infos, the current design and implementations are convention-based, like SPM itself. This is still far from the perfect. However, it is enough for many cases although not flexible for covering 100%. There are many reasons for this, such as, limited development resources, bugs in Sourcekit tools or the lacks of understanding to current Sourcekit protocol. I'd like to continue to improve the experience.
Apache License v2.
3rd-party Sources Thanks
- dbgmits, very nice structure of sources, but of which in my heavy modification to support non-MI and much more