You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/topics/k2-compiler-migration-guide.md
+14-16Lines changed: 14 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,9 +17,8 @@ The new architecture and enriched data structure enables the K2 compiler to prov
17
17
***Easier introduction of syntactic sugar for new language features**. In the future, you'll be able to use more concise,
18
18
readable code when new features are introduced.
19
19
***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).
23
22
24
23
This guide:
25
24
@@ -556,29 +555,28 @@ For more information on what is possible with build reports, see [Build reports]
556
555
557
556
## Support in IDEs
558
557
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.
562
559
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/).
565
561
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**.
567
565
2. Select the **Enable K2 mode** option.
568
566
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.
570
573
571
574
> 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
573
576
> issues due to unrecognized language features.
574
577
>
575
578
{style="note"}
576
579
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
-
582
580
## Try the Kotlin K2 compiler in the Kotlin Playground
583
581
584
582
The Kotlin Playground supports Kotlin 2.0.0 and later releases. [Check it out!](https://pl.kotl.in/czuoQprce)
Copy file name to clipboardExpand all lines: docs/topics/releases.md
+10-7Lines changed: 10 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,16 +73,19 @@ If you are migrating to the new language release, Kotlin plugin's migration tool
73
73
74
74
## IDE support
75
75
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.
78
78
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.
81
80
82
-
{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/).
83
82
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/).
0 commit comments