Paul Krill
Editor at Large

JetBrains IntelliJ IDE to add K2 compiler mode

news
Mar 28, 20242 mins

K2 compiler provides significantly faster and more stable Kotlin code highlighting and Kotlin code completion, JetBrains said.

shutterstock 1865595781 K2 peak in the Himalayas the second highest mountain in the world
Credit: Hussain Warraich / Shutterstock

JetBrains’ IntelliJ IDEA 2024.1, a release of the integrated development environment (IDE) due on April 4, will feature an optional K2 compiler mode, enabling developers to use K2 for faster and more robust Kotlin code analysis, the company said.

With this planned release, the IDE for Kotlin and Java will have two modes. The class mode, enabled by default, will use the standard K1 Kotlin compiler to analyze Kotlin code. The K2 mode will use the new K2 compiler as its code analysis engine. The K2 mode now is in an alpha state. The company made the announcement in a March 25 blog post.

The two modes affect only code analysis. If developers want to compile a project to the K2 compiler, they will need to specify this in build settings. JetBrains describes K2 as a high-performance compiler for the Kotlin language. With the K2 mode, JetBrains developers rewrote the compiler from scratch to improve performance and enhance the internal architecture for further development of the Kotlin language. The K2 mode will support future language features that will only be provided in the K2 compiler, JetBrains said.

The K2 mode in IntelliJ IDEA 2024.1 supports code highlighting and completion, navigation, debugging, refactoring, and editing features such as code formatting and type hierarchy. Also supported are popular inspections, quick fixes, new project wizards, wizard importing, and running tests and applications from IntelliJ IDEA.

However, K2 mode in version 2024.1 does not support Kotlin Multiplatform projects, Android projects, extract function refactoring, inlay hints, or Java-to-Kotlin conversion. Also, third-party IntelliJ IDEA plugins that depend on the Kotlin plugin will be disabled. JetBrains said that support for missing features and an easy-to-use API for third-party plugins will be added in upcoming releases.

The company promised to provide migration guidance for plugin authors soon.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author