IntelliJ IDEA 2018.2 Early Access Program Is Open!
IntelliJ IDEA 2018.2 Early Access Program Is Open!
Want to take a look at the latest features coming to IntelliJ IDEA? Jump into the Early Access Program to get started with the newest version of your favorite IDE.
Join the DZone community and get the full member experience.Join For Free
Today we are excited to announce the start of the IntelliJ IDEA 2018.2 Early Access Program! Here are just a few reasons to download the first EAP build: the MacBook Touch Bar support, improvements in the Gradle support, new icons, Spring Boot goodies, a bunch of new inspections, and much more!
For those of you who were expecting the MacBook Touch Bar support in IntelliJ IDEA, we have some welcome news for you – your days of waiting are over! The upcoming IntelliJ IDEA 2018.2 introduces the Touch Bar support!
Now you can run, build, and debug your project, along with committing changes or updating the project right from the Touch Bar. The Touch Bar shows the controls depending on the context or which modifier keys you press. We support the most popular contexts, and even better – the contexts can be customized!
The IntelliJ IDEA buttons are displayed in the app-specific area in the middle of the Touch Bar interface, while its left part does not change in different contexts, the VCS buttons can be replaced. For example, when the Maven or the Gradle toolbar gets the focus, the refresh (re-import) actions replace the VCS buttons.
To select a configuration, simply press on the run/build configuration popover.
If no configurations have been created, the Touch Bar shows the Add Configuration button.
The debugger is an essential part of the IDE, so we have given it its own special layout, so when the Debug Tool Window becomes active, the Touch Bar shows:
When the debugger is paused or has stopped at a breakpoint, the Pause button is replaced with a Resume button, and the Touch Bar displays the Step and the Evaluate Expression buttons:
Need more debugger actions? Press the Alt key.
For the dialogs, the confirmation buttons are displayed in the center of the Touch Bar.
How to Customize the Touch Bar
You can currently configure both the main context and the debugger context of the Touch Bar. If you have a laptop with a Touch Bar, there is now a new Touch Bar page under Preferences | Appearance & Behaviour | Menus and Toolbars.
Try it right now and see for yourself. We’d love to hear about your experience of using the Touch bar with IntelliJ IDEA; please share your feedback with us!
The code completion in IntelliJ IDEA continues to evolve, and now the IDE shows both all the possible auto-completions and Javadoc, at the same time (without the need to directly invoke Javadoc each time). Please be aware that you need to actually enable this cool new feature. Go to Preferences | Editor | General | Code Completion and turn on the Show the documentation info pop-up in… options.
The code completion now suggests the Collectors.joining() collector for the String stream.
Additionally, the code completion now suggests members of the known common super-type.
The IDE will also now display known data flow information right inside the editor you just need to invoke the Expression type action (Ctrl+Shift+P by default) for the second time.
We’ve updated some of our existing inspections too due to Java 10 API changes. For starters, the loop to stream API migration inspection now uses the new toUnmodifiableList/Set/Map collectors automatically, if the original result was wrapped with Collections.unmodifiableList/Set/Map.
The reverse conversion – the Stream to loop inspection also supports the Java 10 collectors: toUnmodifiableList, toUnmodifiableSet, toUnmodifiableMap.
The Stream API support was improved with the upcoming IntelliJ IDEA 2018.2, so now the IDE detects cases when a sorted stream collects an unsorted collection. As this indicates that either the sorting is unnecessary or that using the collector or collection is wrong. Now, you’ll get a warning about the redundant distinct() call before collect(toSet()), as when collecting to the Set, the result will be distinct, anyway.
The IDE now suggests folding a boolean expression into a Stream chain, if you have at least three stream elements. It works for a && chains, || chains, and also some of the + chains ( getSomething(“foo”)+”,”+getSomething(“bar”)+”,”+getSomething(“baz”) can be converted into Stream.of(“foo”, “bar”, “baz”).map(this::getSomething).collect(joining(“,”))).
Please note that by default this inspection doesn’t highlight code or issue a warning. You can evoke this inspection by clicking alt+enter and apply the fix. As this is an inspection, you can run it in a scope to find all the possible places where it’s applicable.
In IntelliJ IDEA 2018.1 we’ve merged all the inspections that detect a redundant string operation into a single Redundant String operation inspection. With the upcoming IntelliJ IDEA 2018.2 we’ve continued our work on the detection of the redundant string operations, and now the IDE shows cases when a substring has the length of the string on which the substring is called as a second parameter.
We’ve even updated the Unnecessary call to ‘String.valueof’ inspection and renamed this inspection into Unnecessary conversion to String. Now this inspection detects unnecessary calls to static toString() methods such as Integer.toString(x) or Boolean.toString(b).
The Join Lines (Ctrl+Shift+J on Linux/Windows/macOS) action has been improved; now it can merge multiple methods calls into a chained call. It works for any method call where the return type is the same as the qualifier type. This also works on a declaration or assignment line with a subsequent call.
The Join Lines action now produces a cleaner result with the nested if, and when joining lines with an unnecessary 0.
IntelliJ IDEA 2018.2 will support Java 11! Stay tuned you are not going to want to miss the dedicated blog post about Java 11 features in your favorite IDE!
You can now debug a Gradle script in IntelliJ IDEA. Previously, you could debug a build.gradle file only as a Groovy script, but those dark days are over. With IntelliJ IDEA 2018.2 you can now debug a gradle.build file and set a breakpoint not only at the top level of the Gradle build script but also in the Gradle DSL blocks.
We have significantly improved the debugging of Gradle tasks. The debugger can connect to the Gradle daemon, or to any java process that was started by Gradle for tasks that implement the org.gradle.process.JavaForkOptions interface.
Another improvement in this area is the auto-discovery of an included buildSrc Gradle project. Now, the IDE links Gradle’s buildSrc sources and their usages in a build. So you can now navigate from the build scripts to the buildSrc source.
We’ve improved Maven support in IntelliJ IDEA so now when the IDE highlights dynamically created properties; it also provides a handy quick-fix to suppress this warning.
Furthermore, the IDE also now works correctly with the maven-compiler-plugin version 3.7.0, and supports the <release> option.
Spring and Spring Boot
We have significantly improved the performance of Spring projects.
As you may already know, IntelliJ IDEA provides dedicated Spring diagrams to make it easier to quickly analyze even complex Spring and Spring Boot projects.
You can view the dependencies between beans using Spring Beans diagram or view the relationship between configuration files by utilizing the Spring Model Dependencies diagram. These diagrams are extremely useful. However, these are static diagrams that are based on static XML or Java configuration files. But what if you want to view a dependencies graph for runtime beans?
In the upcoming IntelliJ IDEA 2018.2, you can select the new Diagram Mode option and visualize the dependencies between runtime beans of a Spring Boot application.
Click the new Diagram Mode icon in the right gutter of the Beans tab in the Run Dashboard (after you’ve started your application); then you can view the Spring Runtime Beans diagram for the whole application.
As you may recall, with IntelliJ IDEA 2018.1 we’ve introduced a new runtime feature that gives you the ability to access HTTP request mappings from the editor via the new editor-based REST Client. The upcoming major update v2018.2 has enhanced this feature even further, so you can manage your HTTP requests mappings from the Run Dashboard.
After you run your application, you can select the request you need from the Mappings tab and either run your HTTP request straight away or open it in the editor-based REST client.
For GET methods you have the additional option to open a HTTP request in the browser.
Improvements are also being made for Version Control Systems. Firstly, to make it much easier for you to find files with merge conflicts, the upcoming IntelliJ IDEA 2018.2 groups such files under a new Merge Conflicts node for each changelist. You can invoke and resolve the merge conflicts by simply clicking on the Resolve action.
Favorite branches were added to the Branch filter in the Log tab of the Version Control tool window, so you can now quickly filter commits by your favorite branches.
One more improvement to the VCS Log tab is that you can now open as many Log tabs as needed, set different filters for each Log tab, and monitor the changes in separate tabs. There is no need to switch back and forth between different filters anymore.
Additionally, you can now preview Diff in the VCS Log.
It is now possible to skip the Push dialog when using Commit and Push action or show it only when pushing to protected branches.
The upcoming IntelliJ IDEA 2018.2 brings support for multiple GitHub accounts. Now you could easily work on your company project and your pet project without the need to switch GitHub account – just configure all accounts you use in the Preferences | Version Control | GitHub, and specify the default GitHub account per project.
We’ve also improved the support for the JSON files in the upcoming IntelliJ IDEA v2018.2.
First of all, the IDE now supports JSON schema v4, schema v6, and schema v7.
You can now easily apply the required JSON schema for a chosen file using the brand new JSON schema drop-down menu in the status bar. To edit the existing Schema Mappings or create your own schema – simply click Edit Schema Mappings…
Another useful improvement in this area is the new action to copy JSON editor breadcrumbs. You can copy either a qualified name or a JSON Pointer. To invoke this action right-click in the editor breadcrumbs.
To check the compliance of a JSON file to an applied JSON schema we’ve added a new inspection.
We’ve improved Java formatting and editing in a number of ways. There is a new option that adds a blank line before the class end and which affects classes and interfaces (but not anonymous classes). The IDE also adds an indent that puts the caret in the correct place (with the Enter key) in a binary expression. There are more small, yet very helpful improvements. For more information please refer to: IDEA-57898, IDEA-98552, IDEA-108112, IDEA-115696, IDEA-153628.
One more useful improvement to the upcoming IntelliJ IDEA 2018.2 – the ability to specify the default directory for opening projects. In the Preferences | Appearance & Behavior | System Settings in the Project Opening section there is a new Default directory field where you can set a directory.
We’ve bundled Kotlin 1.2.40 with the first IntelliJ IDEA 2018.2 EAP build. You can learn more here.
Also, we think you’ve probably already noticed our new icons; we hope you like them!
To see the full list of fixed issues – dive into the full release notes available with this link.
Published at DZone with permission of Zlata Kalyuzhnaya , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.