News

AppCode starts 2016.3 EAP: new Swift formatting features, completion improvements, UI testing support and more!

Today we are starting the Early Access Program for AppCode 2016.3, and the first build is already available on our confluence page. As usual, it contains a heap of new features and improvements, so let’s take a look at them right now!
Splash

Swift code formatting

AppCode comes with a first-class set of Code Style options for Objective-C and C++. Some platform formatting features for Swift were previously implemented in AppCode 3.1, but that initial implementation list was missing many language-specific formatting features. In this update we’ve decided to cover the most important ones based on the top-voted requests in our tracker and public resources.

Colons

Configure spaces before and after colon in type annotations, dictionary types and dictionary key:value pairs. You can find them in Preferences | Editor | Code style | Swift | Spaces | Other, directly after similar options for commas and semicolons:
Colons
As usual, look in the Preview pane to see how changes in formatting options will affect the look of your code.

Closures

Starting with this build, AppCode will keep closure arguments on the same line as they were specified when reformatting the code (⌘⌥L).

In the unlikely case you need closure arguments to be placed on the next line automatically, you can select Parameters on new line when multiline in Wrapping and Braces | Closures.

Sometimes it might be helpful to keep simple closures on one line when passing them as an argument to the function, and now it’s also possible – simply select Wrapping and Braces | Keep when reformatting | Simple closure arguments in one line. And finally, if you want to keep trailing closures and simple blocks on one line, this appropriately named option is there for you:Simple blocks and closures

Functions and methods

First of all, we’ve added a dedicated section for chained method calls formatting, similar to the one for Objective-C/C/C++:
Chained methods
Use settings in this section to select the wrapping behavior:

  • Do not wrap
  • Wrap if long (the maximum number of columns can be specified in Preferences | Editor | Code style)
  • Chop down if long
  • Wrap always

Align when multiline option is also available.

By using the Wrap first call option, you can specify if you want the first method in the chain to be wrapped. Note that in this case the space between the first method in the chain and the beginning of the line is controlled by the continuation indent value set on the Tabs and Indents tab.

Settings for the placement of opening/closing round brackets were added to the sections Method/function declaration parameters and Method/function call arguments:
Parameters

Condition clauses

If you’d like to specify multiple condition statements on different lines, have them aligned simply by selecting the Align when multiline option in the Condition clauses section on the Wrapping and Braces tab.

Completion

Now all entities in the completion popup in Swift should be sorted according to scope in mostly the same way as it was implemented for Objective-C:

  • Local symbols (local variables, parameter names, local functions)
  • Member symbols (class/struct properties, methods) sorted in the following order:
    • Symbols from the same class
    • Symbols from class extensions (if any)
    • Superclass symbols
  • Global symbols

Objective-C users will be glad to know that argument placeholders for pure C/C++ functions are now available in AppCode editor again.

UI testing

This EAP comes with support for running and debugging UI tests on device and simulator in the same way as it was implemented for unit tests. Unfortunately, currently we have an issue with Xcode 8 which prevents the correct running of UI tests, but we are planning to resolve it before the AppCode 2016.3 release.

Semantic highlighting and C++ support

Objective-C developers (as well as C++ ones) will be glad to know that now they are able to switch to semantic highlighting:
Semantic highlightingLearn how to enable this feature here and in case you want it for Swift, vote for this feature request in our tracker.

There are also lots of C++ support improvements implemented by the CLion team which are also available in AppCode, including:

and more. Read about them in the corresponding series of posts.

Version control

Undo commit action is added to the Log context menu and allows you to undo the last change if it’s not pushed yet:Undo commitIn addition, now it’s possible to restore a deleted local branch or alternatively delete the tracked remote branch too.

For projects requiring Git –signoff commits to be used, the corresponding option was added to the Git Commit dialog.

IDE interface improvements

First of all, the default UI font is now San Francisco (SF NS Text) and it’s used across all the menus and tool windows both in the Default and Darcula themes. Another notable improvement is that all default editor color schemes bundled in AppCode are editable by default and do not require you to copy the color scheme first.

That wraps it up! The full release notes can be found here.

Download AppCode 2016.3 EAP

Your AppCode team
JetBrains
The Drive to Develop

Discover more