CLion
 
Get CLion
You are viewing the documentation for an earlier version of CLion.

Swift

Last modified: 11 January 2023

Swift is supported in CLion via the Swift plugin. With this plugin installed and enabled, CLion can be used as a fully-functional Swift IDE on Linux, macOS, and Windows (see this blog post for details).

Swift support in CLion includes the following features:

  • Automatic resolve for project dependencies:

    sync project dependencies

  • Swift Package Manager actions available from the Tools | Swift Package Manager menu:

    Swift Package Manager actions

    Item

    Description

    Resolve Dependencies

    Resolve package dependencies. Dependencies are resolved automatically on project opening. You may also need to invoke this action if you want to update remote dependencies or if you have changed the manifest file.

    Update Dependencies

    Download the latest version of remote dependencies.

    Clean

    Delete package build artefacts.

    Generate Xcode Project

    Generate the .xcodeproj file in the root directory of the package.

  • Detecting and importing changes:

    import changes
  • Code highlighting and completion in .swift files including completion for project targets in Package.swift:

    completion for project targets
  • Code generation Alt+Insert and refactoring Ctrl+Alt+Shift+T options:

    Generate and Refactor This actions
  • Swift-specific code checks including SourceKit inspections (to configure the inspections, go to Settings | Editor | Inspections | Swift):

    Swift code inspections