AppCode 2019.1: Swift 5, improved backlighting, navigation and auto-completion, moving expressions and much more
A week ago, we released AppCode 2019.1 - let's talk about the changes in it. Under the cut a bunch of new, useful, corrected and supplemented.
All the new features of Swift 5 work correctly in AppCode 2019.1:
- SE-0200 Raw text literals
- SE-0213 Literal initialization via coercion
- SE-0216 Dynamic callables
- SE-0224 Support 'less than' operator in compilation conditions
- SE-0227 Identity key path
- SE-0228 Fix
- SE-0230 Flatten nested optionals resulting from
There was a problem with renaming overloaded methods and methods of the parent class - but now it does not exist.
It would seem that it could be simpler and more elementary to the transition to the definition of a method or class? Standard, familiar action.
And all this is true in Objective-C: the type name is separate when initializing the object, the initializer method itself is separate. Accordingly, if the cursor is on the type name, we proceed to the definition of the type, if on the initializer, to the definition of the initializer. But in Swift, things get more complicated. The initializer merged with the type name together, and if we reproduce the behavior of Xcode, we lose the ability to switch to the initializer. If we leave the behavior of AppCode 2018.3.x, we break the user's habit (“like in Xcode”, that is, the transition not to the initializer definition, but to the type definition). For obvious reasons, users do not like it.
As a result, we developed a middle solution: after all, the expression that initializes the object in Swift still consists of two parts. Everything before parentheses is a type name, and everything inside is an initializer signature. Therefore, if the cursor is on the type name, we proceed to the type definition, if inside the parentheses - to the initializer definition:
Both use cases are saved, everyone is happy.
While Xcode users select with the mouse and copy-paste, AppCode users place the cursor on the expression and move it entirely by lightly pressing
Works for loops, functions, methods, classes, conditions, in general, for almost everything.
How to turn a single-line literal into multi-line? In AppCode, just click
Backlight, auto-completion, code analysis and all-all-all
The more correctly we build the symbol tree, which is used for highlighting, code analysis, navigation, and other IDE functions (even for displaying variables in the debugger), the better and more correctly the AppCode will work. In this release, we solved several fundamental problems that spoiled the lives of users:
- We began to build library symbols for both simulators and devices. Previously, they built only for the simulator.
- Having done this, they began to correctly determine the current platform (simulator / device) and correctly transfer its clang-annotator to Objective-C and SourceKit to Swift. Why is it important? For example, SourceKit will not display errors and warnings if it is incorrect for him to pass the folder with the assembly products in the arguments. This problem should disappear.
- We began to correctly process DerivedSources and all the sources generated in this folder (Core Data, Intents).
Objective-C / C / C ++
Colleagues from CLion added naming styles for code constructs for C / C ++, and we also got them for Objective-C (
Preferences | Editor | Code Style | C/C++/Objective-C | Naming Convention):
Launch and debugging
AppCode is now able to join processes running not only on the simulator, but also on the device (
Attach to process):
Added the ability to select the application language and region in the launch configuration settings:
Run to Cursor can be called not only through
⌥F9, but also by clicking on the line number in the editor:
Recalculation of variables during debugging can now be disabled using the Mute Variables action in the context menu:
Themes for the IDE
Внимательный читатель уже заметил, что все скриншоты в посте сделаны с использованием новой темы оформления Dark Purple:
Темы IDE теперь можно делать самостоятельно, поэтому в репозитории плагинов кроме нескольких тем, сделанных нами, уже можно найти несколько пользовательских вариантов оформления. А до 3-го мая можно не только сделать свою тему, но и поучаствовать в конкурсе, недавно анонсированном нами.
Список недавно просмотренных / измененных участков кода
Есть несколько полезных действий для навигации к недавно открытым или измененным местам в коде:
- Recent Files (
- Switcher (
- Jump to Last Edit Location (
Moving to the last edited section of code is generally difficult to overestimate, especially when editing a large file.
Now a list of recently viewed / changed places of Recent Locations (
⇧⌘E) has appeared:
This is the release. Write all questions, wishes and even bug reports right here in the comments - we will be happy to answer!