IntelliJ IDEA 2021.2 EAP Is Open!
Welcome to our second Early Access Program this year! It will offer a glimpse of the new features that will be included in the upcoming IntelliJ IDEA 2021.2, in addition to introducing useful quality improvements.
The first EAP version is now available, offering automatic browser page reload when you save changes in the IDE, Ktor integration, WSL 2 and Run Targets for Kotlin, correct code highlighting when file system refresh is running, Java updates, and more.
This post describes the most promising updates of week one. Read on!
Browser pages reload on save
To try this new feature, open an HTML file, hover over the code, and click on the icon for the browser you want to use – all browsers are supported. You can also preview the file in a browser by going to View | Open in Browser in the main menu.
Reloading on save is turned on by default. To tweak the settings for it or to turn it off, go to the Built-in Server section in Preferences / Settings | Build, Execution, Deployment | Debugger. When you use the feature for the first time, you’ll also see a popup with a link to the same settings.
Please give this feature a try and let us know what you think about it.
Code insight during file system refresh
Code analysis works correctly, and highlighting is no longer paused, when file system refresh is running.
New JavaFX project wizard
To save you time configuring settings after project creation, we’ve reworked the new project wizard for JavaFX. It only takes two steps. First, you add a project SDK and the language you will use, the desired build system, and the test framework.
Then you will have the opportunity to choose from a list of the most frequently used libraries, which come with short descriptions on the right. Once you create your new JavaFX project, your IDE will generate a fully configured sample application.
We have good news for those who need to configure IntelliJ IDEA to address particular needs. We’ve added a new node to Preferences | Settings – Advanced Settings. It contains some use-case-specific options conveniently grouped by IDE tool. Most of the settings have been transferred from the Registry, though some of them are new.
For example, you can add a left margin in Distraction-free mode, or set the caret to move down after you use the Comment with Line Comment action.
Stay tuned, because we are planning to add more settings to this node soon!
Automatic cache and logs cleanup
After each major update, your IDE will automatically clean up any cache and log directories that were last updated more than 180 days ago. During this process, the system settings and plugin directories stay intact.
You can also trigger this process manually using the Help | Delete Leftover IDE Directories… action.
Default directory locations are described in this article.
Multiple copyright years
This EAP version introduces support for including both the project creation year and the current version year in a project’s copyright notice. When you add a new copyright profile, you will see a template including both dates. Please refer to the originalComment variable when you need to access an existing copyright notice.
New navigation option in Preferences/Settings
Starting from this EAP, it is possible to navigate back and forth between open sections in Preferences/Settings. To do so, use the arrows in the right-hand corner of the window.
It’s easier to code with the enabled screen reader mode on macOS – a list of available suggestions for code completion is now read out loud. We’ve also voiced the content of the selected combo box as well as the combo box lists.
What’s more, you can effortlessly use the Search Everywhere action because the results of the search are now properly pronounced.
Ktor, a web application framework for creating connected systems, now comes bundled in IntelliJ IDEA Ultimate. You can create a new Ktor project for developing server-side or client-side applications from the Welcome screen. In the New Project wizard, it is possible to configure the basic project settings and various features supported by Ktor.
In all the upcoming EAP builds, Kotlin code completion will work based on the machine learning mechanism by default. This will allow the IDE to prioritize code suggestions more helpfully, as it draws on the choices of thousands of real users in similar situations. The related configurations are located in Preferences/Settings | Editor | Code Completion. Please test it and share your feedback.
Run tests before code analysis finishes
If your file contains any tests, you no longer need to wait until the code analysis finishes to start running them. The Run test icon appears in the gutter as soon as you open the file, so you can click it and launch the tests immediately. We hope this will save you some time.
Kotlin plugin in the IntelliJ IDEA repo
We’ve moved the entire Kotlin plugin to the IntelliJ IDEA codebase. You can access this open-source plugin’s repository in the IntelliJ IDEA project. This move will allow platform changes to reach Kotlin faster, and it also means that Kotlin fixes will be promptly delivered to the IDE.
More room for action during indexing
While the IDE is indexing a project, it is now possible to run and debug your application. This was not previously possible, as the buttons associated with Run/Debug Configuration were inactive.
Kotlin support for WSL 2 and Run Targets
Updated inspection descriptions
We’ve been working hard to improve your experience with a number of our Java inspections and quick-fixes. You can now read comprehensive descriptions of them, and even see the examples of usages.
The updated descriptions are available in Preferences/Settings | Editor | Inspections.
Visibility-based color settings
To improve the readability of your code and allow you to browse through it faster, we’ve made it possible to configure color settings for public, protected, and private Java members (methods, fields, classes). You can change these settings in Preferences/Settings | Editor | Color Scheme by unfolding the Visibility node.
This EAP makes it possible to add new JLink artifacts to your project in the Project structure window. This will allow you to create a custom JDK that contains only the modules and dependencies you need when working on a Jigsaw project.
Ant support in WSL 2
It is now possible to execute Ant tasks in WSL 2.
Unified Show Diff
Starting from v2021.2, IntelliJ IDEA will display the difference between the initial and changed files in the editor. It doesn’t matter how you invoke the Show Diff action – via a shortcut, icon, from the context menu, from Log or File History, or by clicking on a file in the Commit view – the IDE will open the diff in the editor by default.
If you find it more convenient to track changes in a separate window, you can drag the desired file from the editor. If you do, the IDE will remember this and will open future diffs in a separate window.
To go back to the default display, click the gear icon and select Show Diff in Editor Tab.
Space job statuses in the Git log
To help you quickly track a job’s progress by just looking at the commits list, we’ve added icons for Space job statuses in the Log tab of the Git tool window. Clicking on an icon will open a popup with the automation info for that job.
You can easily hide the status information by clicking the eye icon above the log and selecting Show Columns | Space Automation.
We are continuing to refine your IntelliJ IDEA experience. Here are some recent quality improvements:
- We returned the support for transparent title bars on macOS and enabled it by default. [IDEA-236114]
- More obvious highlighting for expressions that require a semicolon at the end of a line is available now. [IDEA-265053]
- When you extract a constant and tick the Replaces all the occurrences checkbox, the IDE remembers this state and will keep the selection the next time you apply this refactoring. [IDEA-162111]
- When you get the Command line is too long error on Windows, you can click Shorten the command line and rerun right in the error popup, and the IDE will offer an automatic fix. [IDEA-257348]
That’s it for week one! Please test the new features and share your feedback in the comment section for this post, and please report any bugs you encounter to our issue tracker.