Thanks to Apple open sourcing Swift compiler and libraries earlier this month, JetBrains added support for Swift to its cross-platform IDE, CLion, running both on Linux and OS X.
In order to be able to use Swift with CLion, developers are required to install a CLion’s plugin and the Swift toolchain. Once the Swift toolchain is properly setup, developers can create a Swift project using the provided CMake template.
CLion’s Swift plugin includes support for:
- Parsing/resolving classes in project and standard library;
- Code highlighting and completion;
- Code formatter with Swift-specific style settings;
- Visual debugging based on LLVM, including values and type rendering, and expression evaluation.
JetBrains is also maker of AppCode, a standalone IDE aimed to iOS and OS X development that already included support for Swift. AppCode is only available for the OS X platform, so it is not an option for Linux developers.
According to JetBrains’ Anastasia Kazakova, CLion’s plugin uses JetBrains’ own AppCode parser for the Swift language, thus not relying on the compiler’s, due to its better integration with their IDE for tasks like quickly building a full-project symbol index, supporting refactoring, etc. Indeed, says Kazakova, one of the reason why the Swift plugin was added to CLion and not to IntelliJ IDEA, is that CLion and AppCode already had a lot of things in common, and this made supporting Swift easier. She also remarked that at the moment JetBrains have no plans to introduce support for Swift to IntelliJ IDEA.
CLion’s Swift plugin is available with CLion 1.5 Early Access Program. It is worth noting that build 144.2151.8 for Linux is accidentally missing the LLDBFrontend, which can be downloaded separately.