Swift plugin for CLion

Posted on by Anastasia Kazakova

Hi,

Upd. Version 2017.1 brought Swift 3.1 support, SourceKit-based inspections and intentions, create new project wizard and ability to generate type from usage. Read more.

Upd. Swift plugin for CLion 2016.3 version adds Swift 3 support. Read more.

Upd. Swift plugin for CLion 2016.2 version adds Swift 2.2 support, Introduce Variable refactoring and parameter placeholders for Swift.

Recently we’ve opened the Early Access Program for CLion 1.5. In this post we highlight another new feature: Swift support in CLion!

Background

This summer Apple promised to open source Swift language before the end of 2015, and just recently they did it! Now developers can contribute to Swift compiler and standard library, SourceKit, core libraries like Foundation, libdispatch and XCTest, Swift package manager, LLDB for Swift, and more.

This work involved not only OS X, with many Linux developers joining in as well. This has created a growing need for a Swift IDE on several platforms, especially on Linux. We at JetBrains do support iOS/OS X development, including Objective-C and Swift languages, with a standalone IDE called AppCode. It’s compatible with Xcode and its main focus is iOS/OS X development (meaning toolchains, environment, etc.). Unfortunately, if you’d like to try Swift on Linux, AppCode is not a proper choice.

CLion, on the other hand, is cross-platform. And with Swift compiler and libraries open-sourced, we’ve managed to take the platform-independent part of Swift support and brought it to CLion via a separate plugin. That means you can use CLion as a Swift IDE on Linux!

Initial setup

Getting started with Swift in CLion takes a few simple steps:

  1. Install the plugin from our repository.
  2. Download and setup the Swift toolchain (make sure you get the development snapshot, not the release one).
  3. In CLion settings Build, Execution, Deployment | Swift specify a Swift SDK (on OS X the default is /Library/Developer/Toolchains/swift-latest.xctoolchain, and on Linux it’s empty):
    settings_norm
  4. If you are planning to use Swift debugger, enable Use Swift debugger.
    (Note: Since the debugger comes from the Swift SDK and is customized, avoid using it for debugging non-Swift programs.)
  5. CLion relies on CMake project model, so you need to start a CMake project for Swift. To simplify the configuration process, we’ve added a special CMake live template that adds a Swift build target:
    live_template
    SWIFT_SDK variable expands to the value specified in the settings.
  6. A sample CMake configuration file may look like this:
    sample_cmake
  7. After you build the project, .build directory will be created in your project folder. Now all you need to run the project is to add an executable that is located in .build directory to the configuration corresponding to your target name (in our case it’s HelloSwift).

And now you are ready for Swift!

Features

The set of features includes the most essential ones for you to try:

  • Parse/resolve classes in project and standard library (note that non-standard libraries are not resolved yet).
  • Code highlighting and completion:
    completion
  • Swift code formatter with a separate set of Swift code style settings:
    code_style
  • Navigation actions and File structure view.
  • Find usages.
  • Rename refactoring:
    refactoring
  • Override/Implement for functions and protocols.
  • And even a debugger, including proper rendering of variables and types:
    debug

    and expression evaluation:
    evaluate_code_fragment1

    Please note that on OS X the Swift debugger itself seems to have problems and fails to render classes correctly.

To see the above features in action, watch this short demo:
https://www.youtube.com/watch?v=PQ1dL47dPr0

Share your feedback in the comments section below. We’ll be glad to hear what you think about the Swift plugin for CLion! And we’ll rely on your feedback in our decision where to move forward with the plugin.

Sincerely yours,
The CLion Team

Comments below can no longer be edited.

100 Responses to Swift plugin for CLion

  1. Alex Polozov says:

    December 16, 2015

    Why just CLion and not a general IDEA Platform plugin?

    • Anastasia Kazakova says:

      December 17, 2015

      Actually it was much easier, since CLion and AppCode have a lot in common, and CMake support worked as a charmed (and it’s in CLion now).

      • Lubos Strapko says:

        April 17, 2017

        Is it possible to have SWIFT for linux support also in IDEA in some future? Opening the same project in CLion and IDEA is a real mess. And switching between this 2 idea’s is a real pain.

        • Anastasia Kazakova says:

          April 17, 2017

          Why do you need one project in both?

          • Alex Davis says:

            September 23, 2017

            Here’s a use case:
            I have a project which is a Swift web server, but I’m doing my views in Haml, a Ruby-based language. So currently I have to open a CLion project with the server-side code, and then I have a separate RubyMine project with my clent-side code (Haml, CSS, JS).
            If it were available in IDEA, then I’d be able to use one project for both. I don’t particularly mind it the way it is right now, having two separate projects, and I don’t think it should be a high priority, but I figured I’d let you know that there are situations where this is applicable.

            • Anastasia Kazakova says:

              September 24, 2017

              Thanks for the detailed answer.

          • Tamim Attafi says:

            February 25, 2020

            For Example for Kotlin Multi-Platform projects

            • Anastasia Kazakova says:

              February 25, 2020

              Kotlin/Native is also available in CLion, so you can use both Switch and Kotlin there

  2. Edu Garcia says:

    December 16, 2015

    This is fantastic news!

    But I’ll ask a question that I’m sure I’m not alone wondering: Will this come to IDEA as well? I understand C/C++ not coming, because it’s the “core” of CLion (although you can say the same about HTML/JS and WebStorm, but I digress), but as Swift is not confined to a single IDE now, is there any reason why it won’t make it’s way to IDEA?

    Thank you in advance for your response

    • Anastasia Kazakova says:

      December 17, 2015

      Thanks!

      Swift plugin for CLion was now more essential since AppCode and CLion have a lot of things in common, and CMake in CLion worked well for Swift projects on Linux. However, none of these (AppCode, CLion) are currently included into IntelliJ IDEA. We could consider some of these later, but currently more tasks in the queue with much higher priority.

  3. Hisham says:

    December 17, 2015

    So is the plan to only have Swift support for Linux in CLion? What about AppCode?

    • Anastasia Kazakova says:

      December 17, 2015

      AppCode is an IDE for iOS/OS X dev, so it has Swift, but for development for Apple devices only. That’s by design. And we were not planning to change the thing. At least no such plans for now.

    • Alexander says:

      March 26, 2016

      To develop in full, you’ll need interface builder (AppCode has replacement as plugin, but it is not actively developed and may not support modern features of xibs and storyboards), iOS/tvOS/watchOS simulators (unless you have almost all such devices), application packager, application uploader. All them are available only on MacOS (if I don’t miss something).

  4. Steve Miller says:

    December 17, 2015

    Great job!! I had been hoping for this, but assumed I’d have to wait for years… This is actually quite exciting.

    A quick question on the comment, “Swift SDK comes with its own LLDB library; avoid using it when debugging non-Swift apps”. Does that mean if I check that box that Swift’s LLDB will be used when debugging a C++ app?

    • Anastasia Kazakova says:

      December 17, 2015

      Yes, so for debugging C++ apps, better use either usual bundled LLDB (if you are on OS X) or bundled/selected GDB.

  5. Dev says:

    December 17, 2015

    This is awesome. I was using gedit for writing Swift on Linux, so this should be a big upgrade 🙂

  6. Даниил Водопьян says:

    December 17, 2015

    Great news!
    A tech question, if i may:
    Does the plugin use clang internally for code parsing/resolving? If it doesn’t, what is it then and now is it better?

    • Anastasia Kazakova says:

      December 17, 2015

      Plugin uses the same parser AppCode does (that means our own), our IDE for iOS/OS X development – https://www.jetbrains.com/objc/. We have it for more than a year already and it works quite well. We are adding new Swift features there all the time.

      • Даниил Водопьян says:

        December 18, 2015

        But why can’t you use clang API? Can I read about the reasoning somewhere?

        Sorry for asking, I believe you have a good reason for anything you do. The thing is that I got an argument with a friend, would be great if you somehow help me out.

        • Anastasia Kazakova says:

          December 18, 2015

          Compiler parser actually is not a thing you can use easily inside the IDE. The main problem is that you need to quickly build a full project symbol index and store it, otherwise you won’t be able to make refactorings, for example, across the whole project.

          If you go to this post (https://blog.jetbrains.com/blog/2015/08/06/jetbrains-way-to-cpp-the-inside-story-of-our-journey/) to the C++ parser section, you could find very similar reasoning why we are not able currently to use libclang for C++ parsing for example.

  7. User says:

    December 17, 2015

    The debugger isn’t working for me:

    Error running App: /home/ubuntu/Applications/clion-144.2151.8/CIDR/cidr-debugger/bin/LLDB/linux/LLDBFrontend not found

    I’m not sure if this is what you mean by ‘non-standard libraries’, but Clion couldn’t resolve a module I’m using. It’d be nice to have built-in support for module maps.

    The “swift build” command wouldn’t work for me, so I had to use “swift Sources/*.swift -I/all/the/dependencies”. Possibly because of that(?) Clion couldn’t find the executable, so I had to add the “-o” flag to specify the output and then manually configure Clion to use it.

    It’d be nice if at setup time the user chooses to include Swift support, for Clion to go download Swift and configure itself to use it.

    This is a great first step and I can’t wait to see where it goes.

    • Anastasia Kazakova says:

      December 18, 2015

      Have you set SDK path correctly? Have you switched on the usage of Swift debugger in settings? Does this /home/ubuntu/Applications/clion-144.2151.8/CIDR/cidr-debugger/bin/LLDB/linux/LLDBFrontend really exist?
      Do you know the reasons why “swift build” command is not working in our case? This could be the source of the problem…

      Yes, only standard library is resolved for now.

      Since you can build your own version of Swift compiler, not sure automatic download makes sense. But feel free to add all your requests/problems into our tracker: https://youtrack.jetbrains.com/issues/CPP

      • User says:

        December 18, 2015

        No, the directory doesn’t exist, starting with the “CIDR” directory. It wasn’t in the Clion file I downloaded, or the Swift plugin, so not sure where I’m supposed to get that, or if it’s just a bug that means it’s accidentally missing in the build.

        My CMake file is something like this:

        add_custom_target(HelloSwift
        COMMAND /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swift Sources/*.swift -I/all/the/dependencies
        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

        Yes, possibly I just need to figure out how to get “swift build” to work with my project. In any case, manually configuring the target executable worked fine.

        OK, thanks. I can’t imagine a large percentage of users would be building their own compiler, but fair point.

        • User says:

          December 18, 2015

          And yes, I had selected to use the Swift debugger in the settings, and I believe I had set the Swift SDK correctly as I could compile and run the app.

          • Anastasia Kazakova says:

            December 18, 2015

            And could you please show which path is set for Swift SDK in settings?

          • User says:

            December 18, 2015

            My swift SDK is at: /home/ubuntu/swift, and this is what is configured in the clion settings.

        • Anastasia Kazakova says:

          December 18, 2015

          Is it just a sample or do you really have “/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swift” in your CMake? Looks like you should have there: /home/ubuntu/swift/usr/bin/swift or similar. Is this the case?

          • User says:

            December 18, 2015

            Yes, just an example (I don’t have the project in front of me). That path is configured correctly for sure as the code compiles and runs.

            • Anastasia Kazakova says:

              December 18, 2015

              Ok, thanks. We’ll try to find out if non-working build command could be the source of the problem or not, and will let you know.

            • Anastasia Kazakova says:

              December 18, 2015

              One more question: could you please show the output for ls command for /home/ubuntu/Applications/clion-144.2151.8/ path?

            • Anastasia Kazakova says:

              December 18, 2015

              Looks like we’ve found the source of the problem. Ubuntu’s installer is missing the LLDBFrontend file accidentally. Sorry for that. We’ll put it shortly to the confluence page and will update the post here with the instruction on how to set it up. Next EAP builds will include the files by themselves. Sorry once again. And thanks for helping us investigate this!

          • User says:

            December 18, 2015

            Thanks

            • Anastasia Kazakova says:

              December 18, 2015

              Done. Please, check the note in number 4 in the instruction in this blog post.

    • Anastasia Kazakova says:

      December 18, 2015

      By the way, have you added the custom target in your CMakeLists.txt. Something like:
      add_custom_target(HelloSwift
      COMMAND /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swift build
      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
      SOURCES Package.swift main.swift MyClass.swift)

  8. Chris Hatton says:

    December 17, 2015

    Great news! JetBrain’s support for Linux in Swift will be a huge boost to the language and ecosystem. This really strengthens the cross-platform roadmap for our product.

    I’m having some trouble with the instructions above, however, which seem to be incomplete; I’ve added the live template, set-up the SDK and my test code builds – but does not run. If I point ‘Executable’ parameter of the Run Configuration to a previously built executable inside ‘.debug’, an LLDB error is thrown.

    How should the run configuration be set up?

    • Anastasia Kazakova says:

      December 18, 2015

      Could you please share the content of the CMake file and which LLDB error you get?

  9. Tim says:

    December 18, 2015

    Could you pls. explain how to set up Executable for swift project?
    https://i.imgur.com/CRqznMd.jpg

    • Anastasia Kazakova says:

      December 18, 2015

      If you’d added a custom target, smth like:
      add_custom_target(HelloSwift
      COMMAND /usr/bin/swift build
      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
      SOURCES Package.swift main.swift MyClass.swift)
      Then go to HelloSwift configuration for this target and after building select an executable from the .build directory.

    • Anastasia Kazakova says:

      December 18, 2015

      let me know if it helps

      • Tim says:

        December 18, 2015

        I added custom target then build it but still can’t run project see screenshot:

        http://i.imgur.com/bHKNASN.jpg

        What I should select as Executable? It seems Clion can’t build swift project properly or I’m doing something wrong.

        • Anastasia Kazakova says:

          December 18, 2015

          First, you are missing the custom target name in your CMake command. In my sample it’s HelloSwift.
          Then, let’s check what directories do you have in your project after you successfully build the project. You should have .build in there.
          Then, you need to Edit configuration HelloSwift (Build All is cmake special configuration for building all the project), and set an executable there. Press “Select other” in the drop down menu and if needed select “Show hidden files and directories” while searching for the .build dir in the list.

          • Tim says:

            December 18, 2015

            Sorry Anastasia you’re right it was my fault I forgot to add custom target name.

            • Anastasia Kazakova says:

              December 18, 2015

              Do ou have .build directory created after project building now?

              • Tim says:

                December 18, 2015

                “Do ou have .build directory created after project building now?”

                No I don’t have .build directory. https://i.imgur.com/YLJQgBr.jpg
                I don’t know what I’m doing wrong. But at least in terminal using swift build command it works.

              • Anastasia Kazakova says:

                December 18, 2015

                What I see on the screenshot is a Build all configuration, since it’s All Targets, not the swift_hello target.
                Then, have you built this configuration from CLion? Run | Build (or Ctrl+F9)

              • Tim says:

                December 18, 2015

                “Then, have you built this configuration from CLion? Run | Build (or Ctrl+F9)”

                Yes I used Clean then Build (Alt+Shift+D/Ctrl+F9) then tried Shift+F10 (Run Build All) and got Error: Executable is not specified.

              • Anastasia Kazakova says:

                December 18, 2015

                Ok, could you please build the project, then compress the project directory (the whole one, including .idea and others) and send it to clion-support at jetbrains.com? We’ll what’s going on there.

              • Tim says:

                December 18, 2015

                I sent project with logs.

              • Anastasia Kazakova says:

                December 18, 2015

                Got it, thanks. I’ll have a look shortly and reply via email.

          • Arno.Nyhm says:

            April 4, 2017

            what was the solution of this problem?

            • Anastasia Kazakova says:

              April 5, 2017

              The CMake target was not configured properly in the user’s project.

  10. Tim says:

    December 18, 2015

    By the way after building there’s no .build directory.

  11. Swift says:

    December 24, 2015

    Hello

    Can you please paste the code of the CMakeList instead of a screenshot

    thanks

    • Anastasia Kazakova says:

      December 25, 2015

      You can easily generate this CMake with add_swift live template. It will take proper swift SDK path from the settings automatically, you’ll just need to write target name.

      cmake_minimum_required(VERSION 3.4)
      project(HelloSwift)
      add_custom_target(HelloSwift
              COMMAND /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swift build
              WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
              SOURCES Package.swift main.swift MyClass.swift)
      
  12. wu says:

    January 20, 2016

    error: no Package.swift file found

    • Anastasia Kazakova says:

      January 20, 2016

      Do you actually have this file in our project? Could you please share the project you are testing on?

  13. wu says:

    January 20, 2016

    15:37:20 Build finished in 183ms
    15:37:20 Error running s04: File not found: /home/wz/.CLion15/system/cmake/generated/s04-de9964d6/de9964d6/Debug/s04

    • wu says:

      January 20, 2016

      Hello

      That’s the project logs on Ubuntu.

      CMake file like this :
      add_custom_target(s04
      COMMAND /home/wz/swift/swift-2.2-SNAPSHOT-2016-01-11-a-ubuntu15.10/usr/bin/swift build
      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
      SOURCES Package.swift main.swift)

    • wu says:

      January 20, 2016

      /home/wz/.local/share/Trash/files/clion-144.2608.6/bin/cmake/bin/cmake –build /home/wz/.CLion15/system/cmake/generated/s04-de9964d6/de9964d6/Debug –target s04 — -j 2
      error: Your source structure is not supported due to invalid sources layout: /home/wz/ClionProjects/s04. There should be no source files under: /home/wz/ClionProjects/s04.
      That’s the bulid message:

      CMakeFiles/s04.dir/build.make:57: recipe for target ‘CMakeFiles/s04’ failed
      make[3]: *** [CMakeFiles/s04] Error 1
      CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/s04.dir/all’ failed
      make[2]: *** [CMakeFiles/s04.dir/all] Error 2
      CMakeFiles/Makefile2:74: recipe for target ‘CMakeFiles/s04.dir/rule’ failed
      make[1]: *** [CMakeFiles/s04.dir/rule] Error 2
      Makefile:118: recipe for target ‘s04’ failed
      make: *** [s04] Error 2

  14. James Dang says:

    February 3, 2016

    This is great news! With good IDE support now, we just need Swift on Linux to flesh out its core libraries and to support building shared libraries. Then it can really start to pervade the Linux ecosystem.

  15. Mathijs says:

    February 4, 2016

    Great that you guys are working on a swift plugin. I am using the phpstorm IDE for quite a while now and loving it!

    I can’t get one of the main features to work: autocomplete. It does work with the swift types (Int, etc), vars and objects. But not properties, methods or objects from imported libraries. Any suggestion on this?

    • Anastasia Kazakova says:

      February 5, 2016

      Yes, you are right, on Linux completion doesn’t work with imported libraries for now, only with a standard one (https://youtrack.jetbrains.com/issue/CPP-5325).

    • Darian says:

      December 11, 2016

      I’m unable to build the project…
      This is what I get:
      /home/darian/Programi/clion-2016.2.3/bin/cmake/bin/cmake –build /home/darian/Desktop/Swift/Pokusaj/cmake-build-debug –target Pokusaj — -j 1
      error: rootManifestFileNotFound
      CMakeFiles/Pokusaj.dir/build.make:57: recipe for target ‘CMakeFiles/Pokusaj’ failed
      make[3]: *** [CMakeFiles/Pokusaj] Error 1
      CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/Pokusaj.dir/all’ failed
      make[2]: *** [CMakeFiles/Pokusaj.dir/all] Error 2
      CMakeFiles/Makefile2:74: recipe for target ‘CMakeFiles/Pokusaj.dir/rule’ failed
      make[1]: *** [CMakeFiles/Pokusaj.dir/rule] Error 2
      Makefile:118: recipe for target ‘Pokusaj’ failed
      make: *** [Pokusaj] Error 2

      • Anastasia Kazakova says:

        December 11, 2016

        Probably, swift builder is missing Package.swift file?

  16. Lukas says:

    February 28, 2016

    How to configure CMakeLists.txt file that executable will see resources like *.html *.js files from main project folder? I’m trying to run Blackfish-example (https://github.com/elliottminns/blackfish-example) in Clion. Everything works ok, project starts, but executable not see resources files (Public and Resources folder). When I run executable builded manually from terminal then resources for executable are visible.

  17. Lukas says:

    February 28, 2016

    I found that
    file(COPY Resources DESTINATION /Users/plum/Downloads/blackfish-example/.build/debug/)
    file(COPY Public DESTINATION /Users/plum/Downloads/blackfish-example/.build/debug/)
    works for me but better will be I could share resources without copy them to .build/debug

  18. mhmd salem says:

    March 14, 2016

    Plugin ‘Swift’ is incompatible with this installation

  19. David Moles says:

    April 18, 2016

    Is it possible to create a cross-platform project that can be built with either CLion or AppCode?

    • Anastasia Kazakova says:

      April 18, 2016

      CMake is a cross-platform system, so if you have a cross-platform CMake project, you can build it with CLion.

  20. Tom Bruno says:

    April 25, 2016

    I’m now getting a strange error with CLion 2016.1 and swift:

    /home/tbruno/.local/share/umake/ide/clion/bin/cmake/bin/cmake –build /home/tbruno/.CLion2016.1/system/cmake/generated/untitled-6a568cf7/6a568cf7/Debug –target COMMAND — -j 8
    error: unable to invoke subcommand: /home/tbruno/.local/share/umake/swift/swift-lang/usr/bin/swift-build (No such file or directory)

    I don’t know why it thinks the subcommand is swift-build the CMakelists.txt is:
    add_custom_target(
    COMMAND /home/tbruno/.local/share/umake/swift/swift-lang/usr/bin/swift build
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
    SOURCES Package.swift Sources/main.swift)

    • Anastasia Kazakova says:

      April 25, 2016

      Do you have a development swift snapshot (not a release one)?

  21. Christopher Hatton says:

    September 15, 2016

    I have a renewed interest in developing something with Swift 3 on Linux now. Notes after returning to this, using Apples official Swift 3 release:
    – Need to create symlink for expected liblldb using: ln -s ./liblldb.so.3.9.0 liblldb.so.3
    – The need to select executable from .build feels like a big gap in the process.
    – So does CMake setup for Swift, is a ‘New Swift project’ feature too much to ask?
    – Autocompletion is not working at all in IDE.
    I am very much looking to further development and a Swift 3 compatible version of the plugin. Thanks 🙂

    • Anastasia Kazakova says:

      September 15, 2016

      Project template for Swift is planned and hopefully will come soon: https://youtrack.jetbrains.com/issue/CPP-6155

      As for the autocompletion, could you please share the example? What exactly is not completed? Please, note that on Linux completion doesn’t work with imported libraries for now, only with a standard one (https://youtrack.jetbrains.com/issue/CPP-5325).

      Feel free also to add convenient workflow and other feature requests to our tracker.

  22. chnmrc says:

    October 9, 2016

    For when is planned support for module map, i need the autocompletition feature on module dependencies.
    Thank’s for the great IDE under Linux.

    • Anastasia Kazakova says:

      October 10, 2016

      Could you please show an example of what do you mean here?

      • Marco Chini says:

        October 18, 2016

        What i mean is support of autocompletition on Package system with C Module with module.modulemap in swift plugin

        • Anastasia Kazakova says:

          October 18, 2016

          That’s interesting – could you please submit a request to us here: https://youtrack.jetbrains.com/issues/CPP with some samples maybe.

          • @CHNMRC says:

            March 28, 2017

            Hello,
            when is planned to fix
            OC-12868 ?

            • Anastasia Kazakova says:

              March 28, 2017

              There is some work started already, but we had to postpone it due to other tasks with higher priority. Hopefully, this could be finished until the next release (2017.2)

              • Anastasia Kazakova says:

                March 28, 2017

                I just checked that actually the functionality should be in the build already. Do you still experience the problem? Which CLion/plugin versions do you use?

  23. sydd says:

    December 6, 2016

    Hello

    Does the Swift plugin work with Swift 3 on Linux? I see that the plugin is updated regularly, but I cant find changelogs.

    • Anastasia Kazakova says:

      December 6, 2016

      Yes, changes are included there. All Swift language-only features from AppCode (https://blog.jetbrains.com/objc/) are appearing in the corresponding builds of CLion’s plugin.

  24. huay says:

    February 28, 2017

    unable to build the project
    swift-build: error: Empty manifest file is not supported anymore. Use swift package init to autogenerate.

    • Anastasia Kazakova says:

      February 28, 2017

      Is it possible for you to share your project in https://youtrack.jetbrains.com/issues/OC? Not sure what’s going on wrong there for you, need to investigate.

      • huay says:

        February 28, 2017

        Is the problem possible on the swift version? I use the lastest 3.1

        • Anastasia Kazakova says:

          March 1, 2017

          It should be ok, need to investigate deeper. Sample project may help.

  25. Andras Tim says:

    April 26, 2017

    The latest release from Swift is 3.1.1, but the Swift plugin supports only 3.1.0. Where can I download the 3.1.0, because the https://swift.org/download doesn’t contains this version.

    In other hand, why the plugin locks the build number, and not the major, minor version only?

    • Vyacheslav Karpukhin says:

      April 26, 2017

      Swift plugin supports only a specific build of Swift toolchain only on Linux, there is no restriction on macOS. The reason is that Linux builds of Swift toolchain do not contain SourceKit, so CLion plugin has to bundle one. SourceKit is tightly coupled with the rest of the toolchain, and usually works correctly only if everything was built from the same sources.

      You can download 3.1 toolchain by replacing 3.1.1 with 3.1 in the download link.

      We’ll update the Swift plugin shortly. Sorry for the inconvenience.

      • Vyacheslav Karpukhin says:

        April 26, 2017

        The plugin is updated.

        • griboedov says:

          July 20, 2017

          Failed to load SourceKit

          • Mati says:

            July 25, 2017

            Did you installed the libblocksruntime0 and libblocksruntime-dev packages via apt?

  26. charlson says:

    July 9, 2017

    could you please give a detailed way of creating a swift project in clion?. The comments above are still a little bit hard to grasp.

    • Anastasia Kazakova says:

      July 10, 2017

      Swift project is available in the New Project wizard, if you have the Swift plugin installed. Just follow the wizard steps.

  27. Vivek Singh Mehta says:

    September 12, 2017

    Failed to load Sourcekit
    Home/usr/swift/usr/lib/libsourcekitdInProc.so:libBlocksRuntime.so.0:cannot open shared object file:No such file or directory

    • Vyacheslav Karpukhin says:

      September 12, 2017

      Please install the required library (libblocksruntime0 package if you are on Ubuntu). You might need to install other packages listed in the requirements section for Swift project: https://github.com/apple/swift

  28. Sergey Yamshchikov says:

    November 28, 2017

    Hello. I’m not sure that this is right place to ask but don’t know where should I do it. I’m absolutely new in Swift ad CMake and trying to configure Mac/Linux environment to build simple app with https://github.com/PerfectlySoft/Perfect-HTTPServer . I’ve created swift project with swift template in Clion, added dependency for the library. Everything compile and run on both platforms. Only thing that annoying me it’s the fact that CLion doesn’t see classes from the library, I can’t navigate to them or use code completion. Should I add them somehow as a library to CMakeLists.txt or something lese? Is it supported now or not?

Subscribe

Subscribe for updates