IntelliJ IDEA 2020.3 EAP4: LightEdit Improvements, Java Inspections, and More
IntelliJ IDEA 2020.3 EAP4 is out. In this EAP, you will get a sneak peek into the Java-related updates, discover what’s new for LightEdit mode, and learn how we are planning to support the Kotlin plugin.
As always, you are welcome to test out all the new features. You can download the new EAP from our website, install it using the free Toolbox App, or update to this latest EAP using snaps if you’re an Ubuntu user.
We introduced LightEdit mode in v2020.1 as a handy built-in lightweight text editor that you can use without leaving IntelliJ IDEA. Since then, we’ve been polishing it up to make the experience of working with it even better. LightEdit mode in v2020.3 is now independent of other IDE sessions and has a separate launch script option.
If you do not upgrade IntelliJ IDEA via the Toolbox app, make sure you update the command line launcher via Tools / Create Command Line Launcher to use our improvements for LightEdit mode.
We’ve added the -e (–edit) option to open files in LightEdit mode from the command line. Type -e followed by the name of the file you want to open, or just run -e without a file name to reopen your previous session.
Without the -e option, the IDE will open a file in a temporary project that allows you to use all the IntelliJ IDEA features.
From LightEdit to Project
In IntelliJ IDEA 2020.3 EAP4, we’ve added a status bar to the LightEdit mode window that includes a quick link providing access to the full set of IDE features.
Another way to open your file in the Project view from LightEdit mode is via File / Open File in Project… .
Reloading files from disk
If any changes are made to your file externally, you can update it via File / Reload from Disk.
-w (–wait) switch support
If you are used to working from the command line, you’ve surely encountered cases where you needed to use a text editor during an operation – for example, when you commit to Git and want to write a commit message quickly. You can now do that and then automatically return to the initial operation after you finish the message and close the file where you were editing it. For this purpose, use -w (–wait) which now works in combination with the -e option.
Rescheduled updates for the Kotlin plugin
We have not forgotten about our Kotlin users: Kotlin 1.X will be released every six months and the Kotlin plugin will sync with this release. On top of this, we’re adding improvements to the plugin with every IntelliJ IDEA release.
To learn more about the new release schedule, read our blog post about it.
New Java inspections
In v2020.3 we’ve added some Java inspections.
Your code readability may suffer if it contains a lot of unused lines that have been commented out. The new Commented out code inspection allows IntelliJ IDEA to detect these irrelevant pieces of junk code. Press Alt+Enter or click the yellow bulb icon to delete them once and for all, or uncomment them if needed.
If you go to Analyze / Run Inspection by Name, you can apply Commented out code to your project. The IDE will check it and display the results for the whole project in the Inspections Results tool window. You can choose what to do with this code from there, as well.
There is a new inspection that replaces redundant code, shortening your code and speeding up performance. It prompts you to replace String.toLowerCase().equals()/toUpperCase() with String.equalsIgnoreCase().
Another new inspection highlights the lines of code where assert statements and test framework assertions are masked via catch blocks. Without this inspection, such assertions will never fail, as the IDE will catch the thrown AssertionError and silently ignore it.
With this inspection, your IDE spots the creation of a redundant File object and offers to simplify your code for you.
Better code completion
When you use the String.toUpperCase or String.toLowerCase methods, the code completion mechanism now suggests using Locale.ROOT to avoid accidental dependency on the system-default locale. Similarly, when you are about to call String.getBytes(), the IDE offers to use the UTF_8 charset to avoid accidental dependency on the system-default charset.
If you want to create a new class from scratch, the IDE prompts you with a handy completion of the class, interface, enum, or record after the top-level Public declaration.
Improved intention actions
If you mistakenly put a closing parenthesis in a nested call, the IDE will allow you to quick-fix the erroneous syntax. Place the caret inside the problem code and press Alt+Enter or click the red bulb icon to invoke the available intention actions.
Both inner and outer calls now resolve correctly.
That’s it for this week! Stay tuned for more cool features coming next week. You can see the full list of additions in this EAP in the release notes.