AppCode 2019.3: works faster, understands Swift better, knows about Mac Catalyst, conveniently displays assembly messages

In AppCode 2019.3, we focused on speed and language support. In this post we tell what happened (spoiler: they accelerated a lot).


Splash



Performance


It can be difficult to determine how much a particular fix gives an effect on speed - and this is independent of the number of test projects and their complexity. Since 2019.3, everything is easier, because during the preparation of the release, we received a lot of feedback that the performance has really improved. Here's what happened to speed up:


  • Highlighting, navigation and auto-completion in projects on pure Swift and projects with mixed code. Let's just say so - it began to work much faster compared to 2019.2.
  • There is such a caching phase, “Processing Swift Modules”. The interfaces of the Swift modules that are needed for the IDE to work, up to Xcode 11, were in the binary in the toolchain, and their textual representation had to be obtained through SourceKit. SourceKit works slowly, and if for the system frameworks we already put ready-made caches in the installer (which, however, have to be updated for each release of Xcode), this will not work for the frameworks of the project itself. As a result, they found some not the most optimized pieces and corrected, it began to work much faster.

Another part of the improvements is still in operation, and there are quite a few of them. These are additional caches where they do not exist yet, and the improvement of the algorithm for constructing design symbols, and much more. These are already plans for 2020.1.


Language support


Language tasks have the same priority as performance work, so part of the team monitors changes in swift-evolution and, as soon as they are accepted, starts integrating them into AppCode. This release supported:



Actions to modify the code


They are intensified. The AppCode team is growing, and to introduce a new developer to the course, we usually give small, but interesting new features. This time it was a dozen actions for Swift, with which you can:


  • Combine (and vice versa) a variable declaration with a value assigned to it:
    Split / join variable declaration and assignment
  • Split declarations of several variables into separate ones:
    Split variable declarations with multiple elements
  • Split / merge nested if / else:
    Split / join nested if / else statements
  • Swap parts of comparisons or binary expressions:
    Flip comparisons and binary expressions
  • Make inversion if:
    Invert if condition
  • Split / merge conditions inside the same if construct:
    Merge / split conditions
  • Apply de Morgan Laws:
    De Morgan’s Laws

Code Generation


Added two new code generation settings in Editor | Code Style | Swift | Code Generation | General Editor | Code Style | Swift | Code Generation | General Editor | Code Style | Swift | Code Generation | General :


  • Prefer Void over () and
  • Prefer explicit return .

Formatting


At the request of users, they added formatting options in order to:


  • Leave small property blocks with willSet / didSet (Preferences | Editor | Code Style | Swift | Wrapping and Braces | Keep when reformatting | Methods and functions in one line) single-line didSet (Preferences | Editor | Code Style | Swift | Wrapping and Braces | Keep when reformatting | Methods and functions in one line)
  • The same goes for empty type declarations ( Preferences | Editor | Code Style | Swift | Wrapping and Braces | Keep when reformatting | Empty type declarations in one line )

Custom Swift Toolchains


They taught AppCode to work with code correctly when using non-standard Swift toolchains (for example, Swift for Tensorflow ).


Build messages


In one of the previous releases, we had a problem with assembly messages that was not solved in the framework of the current implementation. However, we could not fix it. In addition, there were still problems with the speed of processing messages, their display, frequent changes in the format of these messages from one version of Xcode to another, and many other little things. As a result, we taught AppCode to pick up the assembly message tree directly from the Xcode build system "as is" and simply display it in our Messages :


Build messages


Together with this information, it turned out to find a way to display the normal build progress:


Build messages progress


In the end, we also simplified message filtering and did the same as in Xcode:


Buld Messages filter


Mac Catalyst Support


Everything is simple here: we learned how to work with Mac Catalyst targets so that they can be launched, debugged, displayed in Run Configurations.


That's all. In 2020.1, we plan, as in this release, to spend the maximum time on further optimization of the IDE, with a minimum of new features.


Write all questions and suggestions right here in the comments - we will be happy to answer!


AppCode Team

Source: https://habr.com/ru/post/479450/


All Articles