Skip to content

Commit 72c96a2

Browse files
committed
update: K2 mode is default
1 parent 2afcbbc commit 72c96a2

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed

docs/topics/k2-compiler-migration-guide.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ The new architecture and enriched data structure enables the K2 compiler to prov
1717
* **Easier introduction of syntactic sugar for new language features**. In the future, you'll be able to use more concise,
1818
readable code when new features are introduced.
1919
* **Faster compilation times**. Compilation times can be [significantly faster](#performance-improvements).
20-
* **Enhanced IDE performance**. If you enable K2 mode in IntelliJ IDEA, then IntelliJ IDEA will use the K2 compiler
21-
frontend to analyze your Kotlin code, bringing stability and performance improvements. For more information,
22-
see [Support in IDEs](#support-in-ides).
20+
* **Enhanced IDE performance**. Starting with 2025.1, IntelliJ IDEA uses K2 mode to analyze your Kotlin code, increasing
21+
stability and providing performance improvements. For more information, see [Support in IDEs](#support-in-ides).
2322

2423
This guide:
2524

@@ -556,29 +555,28 @@ For more information on what is possible with build reports, see [Build reports]
556555

557556
## Support in IDEs
558557

559-
By default, both IntelliJ IDEA and Android Studio 2024.1 use the previous compiler for code analysis, code completion,
560-
highlighting, and other IDE-related features. This is to ensure performance and stability while we work on integrating
561-
the new Kotlin K2 compiler.
558+
K2 mode in IntelliJ IDEA and Android Studio uses the K2 compiler to improve code analysis, code completion, and highlighting.
562559

563-
If you'd like to try using the same features with the new Kotlin K2 compiler, support is available from IntelliJ IDEA and
564-
Android Studio 2024.1. To enable K2 mode:
560+
Starting with IntelliJ IDEA 2025.1, K2 mode is [enabled by default](https://blog.jetbrains.com/idea/2025/04/k2-mode-in-intellij-idea-2025-1-current-state-and-faq/).
565561

566-
1. In your IDE, go to **Settings** | **Languages & Frameworks** | **Kotlin**.
562+
In Android Studio, you can enable K2 mode starting with 2024.1 by following these steps:
563+
564+
1. Go to **Settings** | **Languages & Frameworks** | **Kotlin**.
567565
2. Select the **Enable K2 mode** option.
568566

569-
Learn more about K2 mode in our [blog](https://blog.jetbrains.com/idea/2024/11/k2-mode-becomes-stable/).
567+
### Previous IDE behavior {initial-collapse-state="collapsed" collapsible="true"}
568+
569+
If you want to go back to the previous IDE behavior, you can disable K2 mode:
570+
571+
1. Go to **Settings** | **Languages & Frameworks** | **Kotlin**.
572+
2. Deselect the **Enable K2 mode** option.
570573

571574
> We plan to introduce [Stable](components-stability.md#stability-levels-explained) language features after Kotlin 2.1.0.
572-
> Until then, you can continue to use the previous compiler for code analysis, and you won't encounter any code highlighting
575+
> Until then, you can continue to use the previous IDE features for code analysis, and you won't encounter any code highlighting
573576
> issues due to unrecognized language features.
574577
>
575578
{style="note"}
576579

577-
It's important to note that regardless of which compiler you use for code analysis in your IDE, the compiler used
578-
by your build system is **independent** and configured separately in your build script. If you [upgrade your Kotlin version
579-
to Kotlin 2.0.0 in your build scripts](#how-to-enable-the-kotlin-k2-compiler), the new K2 compiler will be used by default
580-
by your build system only.
581-
582580
## Try the Kotlin K2 compiler in the Kotlin Playground
583581

584582
The Kotlin Playground supports Kotlin 2.0.0 and later releases. [Check it out!](https://pl.kotl.in/czuoQprce)

docs/topics/releases.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,19 @@ If you are migrating to the new language release, Kotlin plugin's migration tool
7373

7474
## IDE support
7575

76-
Even with the release of the K2 compiler, IntelliJ IDEA and Android Studio still use the previous compiler by default
77-
for code analysis, code completion, highlighting, and other IDE-related features.
76+
Kotlin has full out-of-the-box support in [IntelliJ IDEA](https://www.jetbrains.com/idea/download/) and
77+
[Android Studio](https://developer.android.com/kotlin/get-started) with an official Kotlin plugin developed by JetBrains.
7878

79-
Starting from 2024.1, IntelliJ IDEA can use the new K2 compiler to analyze your code with its K2 mode.
80-
To enable it, go to **Settings** | **Languages & Frameworks** | **Kotlin** and select the **Enable K2 mode** option.
79+
K2 mode in IntelliJ IDEA and Android Studio uses the K2 compiler to improve code analysis, code completion, and highlighting.
8180

82-
![Enable K2 mode](k2-mode.png){width=200}
81+
Starting with IntelliJ IDEA 2025.1, K2 mode is [enabled by default](https://blog.jetbrains.com/idea/2025/04/k2-mode-in-intellij-idea-2025-1-current-state-and-faq/).
8382

84-
After enabling K2 mode, you may notice differences in IDE analysis due to changes in compiler behavior.
85-
Learn how the new K2 compiler differs from the previous one in the [migration guide](k2-compiler-migration-guide.md).
83+
In Android Studio, you can enable K2 mode starting with 2024.1 by following these steps:
84+
85+
1. Go to **Settings** | **Languages & Frameworks** | **Kotlin**.
86+
2. Select the **Enable K2 mode** option.
87+
88+
Learn more about K2 mode in [our blog](https://blog.jetbrains.com/idea/2025/04/k2-mode-in-intellij-idea-2025-1-current-state-and-faq/).
8689

8790
## Kotlin release compatibility
8891

0 commit comments

Comments
 (0)