Early Access Program

IntelliJ IDEA 2018.2 Goes Beta

IntelliJ IDEA 2018.2 Beta is ready for download! It’s the perfect time to try out all the new features in the upcoming v2018.2: MacBook Touch Bar support, Java 11 support, breakpoint intentions, Spring Boot enhancement, VCS improvements, and more.

800x400_blog@2x_preview (1)

For a while now, we have used the term Public Preview for the updates that entered the Beta phase, but some of you may still remember back in the distant past when we called it Beta, and well, we’ve decided to return to this tradition.

All the main features in this update are already included, and we’re going to focus on checking and polishing up this update from now on. Are you interested in the details on what’s coming in IntelliJ IDEA 2018.2? Read this blog post for a full overview!

User Interface

Are you ready for something different? The upcoming IntelliJ IDEA 2018.2 comes with Touch Bar support! Run, build, and debug your project, commit changes and update the project right from the Touch Bar.

800x400@2x

The IntelliJ IDEA buttons are displayed in the app-specific area in the middle of the Touch Bar interface, and they are dependent on the context or which modifier keys you press.

You can even work with the debugger from the Touch Bar as it has its own layout, which is shown when the Debug Tool Window becomes active.

All available Touch Bar contexts can be customized on the Touch Bar page in Preferences | Appearance & Behaviour | Menus and Toolbars.

There is more welcome news for macOS users as we have now included a new ability to darken the IntelliJ IDEA title bars. Go to Preferences | Appearance & Behavior | Appearance and enable the Use dark window headers option.

image14

Speaking of changes in the UI, if you haven’t noticed, we also have some brand new icons! Why have we decided to update the icons and what are we planning next? Find the answers to these questions in this post.

Editor

It’s now possible to navigate outside the closing brackets, or closing quotes, by pressing Tab when in Java, Kotlin, Groovy, SQL, PHP, JavaScript, and Python files.
Go to Preferences/Settings | Editor | General | Smart keys and enable the Jump outside closing brackets/quote with Tab option.

image11

IntelliJ IDEA underlines reassigned local variables and reassigned parameters, by default. The attributes for all the languages supporting this feature, which for now includes Java and Groovy, can be changed in Preferences/Settings | Editor | Color Scheme | Language Defaults | Identifiers |Reassigned.

image15

When you place a caret at the break or continue keyword, IntelliJ IDEA highlights the for or while keyword of the corresponding loop.

image22

Java

The release of Java 11 is just a few months ahead of us, and we’ve got some more good news for you, the upcoming IntelliJ IDEA 2018.2 already supports local-variable syntax for lambda parameters according to the JEP 323. Learn more here.

image34

The IDE now also displays known data flow information right inside the editor, you just need to invoke the Expression type action (Ctrl+Shift+P by default) a second time. Learn more.

image27

There is no need to directly invoke Javadoc each time anymore – IntelliJ IDEA can display autocompletions and Javadoc, at the same time. You just need to enable the Show the documentation info pop-up in… options in the Preferences | Editor | General | Code Completion.

image17

image33

The upcoming IntelliJ IDEA 2018.2 now displays the type hints for long method chains. It is especially useful to see the type of each call as a type hint for long method chains with generics. For simple builders, where the type is obvious, the IDE will hide the type hint.

image36

The code completion now suggests members of the known common supertype, and as for the String stream, it offers the Collectors.joining() collector.

image30

image5

Because of Java 10 API changes we’ve updated some of our existing inspections. The loop to stream API migration inspection now automatically uses the new toUnmodifiableList/Set/Mapcollectors, 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.

image31

With this major update, we’ve upgraded the Join Lines action(Ctrl+Shift+J on Linux/Windows/macOS). Now on any method call where the return type is the same as the qualifier type the Join Lines action will merge multiple methods calls into a chained call. 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 you are joining lines with an unnecessary 0.

image25
image39

image40

Java refactoring

The upcoming IntelliJ IDEA 2018.2 introduces a new preview panel for the Extract Method refactoring, to review the results of your refactoring before you make any actual changes.

This can be quite useful when you perform refactoring on code fragments with duplicates.
Invoke the Extract Method refactoring, and in the Extract Method dialog click the Preview button to preview all the changes in one place.

image29

New @Contract annotation return values: this, new, paramX

IntelliJ IDEA supports the @Contract annotation, which allows you to specify a method reaction when a particular parameter is passed. The contract information is available for various inspections and actions, which use it to produce better warnings and remove false-positives. With IntelliJ IDEA 2018.2 we’ve extended the @Contract annotation, and now it supports more return values:

  • new – every time the method is executed, it returns a non-null new object.
  • this – the method returns non-null this reference.
  • paramX – the method returns its X-th argument.

For more information please read the blog post.

JVM debugger

Now, while debugging a Java project in IntelliJ IDEA, you have new handy breakpoint intention actions, there is no need to setup the properties of a particular breakpoint by hand anymore, simply press Alt+Enter and the IDE will offer you the new breakpoint intentions, along with all the other available intentions!

The upcoming IntelliJ IDEA 2018.2 also comes with the ability to filter a breakpoint hit by the caller method. You can now stop at a breakpoint if a certain condition applies to the call stack. This new filter allows you to only stop at a breakpoint if it’s called from the specified method. (Or, vice versa, it will not stop at a breakpoint if it’s called from that method).

image18

image10

Gradle

With the upcoming IntelliJ IDEA 2018.2, you can debug a gradle.build file. You can now set a breakpoint not only at the top level of the Gradle build script, but also in the Gradle DSL blocks.

In addition to that, 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.

image6

Another improvement in this area is the auto-discovery of an included buildSrc Gradle project. Now, the IDE links the Gradle buildSrc sources and their usages in a build. So you can now navigate from the build scripts to the buildSrc source.

image37The next major update v2018.2 comes with significantly improved Gradle importing performance.

Maven

With the upcoming IntelliJ IDEA 2018.2, the Maven support has been improved in a number of ways.

The IDE now not only highlights dynamically created properties, but also provides a handy quick-fix for suppressing this warning.

IntelliJ IDEA now also works correctly with the maven-compiler-plugin version 3.7.0, and supports the “release” option.

In addition to all this, we have enhanced our Maven support so that IntelliJ IDEA now correctly parses POM even when the parent POM reference contains a property placeholder. Also, the IDE now resolves properties from the configuration files: .mvn/maven.config and .mvn/jvm.config.

Project Configuration

In the upcoming IntelliJ IDEA 2018.2, you can exclude some of the transitive dependencies when adding a new repository library.
Click on a new ‘Configure’ action link in the library properties editor, to open a new ‘Configure Transitive Dependencies’ dialog where you can select only the necessary transitive dependencies you want to add to your current project.

image26

image3

Version Control Systems

When working with Git, merge conflicts may occur from time to time. To make it easier for you to resolve them, we’ve made several improvements. First of all, it’s now much simpler to find files with merge conflicts in the upcoming IntelliJ IDEA 2018.2, as for each changelist the IDE groups such files under a new Merge Conflicts node. Clicking on the Resolve action link, opens the well-known Files Merged with Conflicts dialog. Speaking of the Files Merged with Conflicts dialog, we’ve also improved it in a number of ways. IntelliJ IDEA now displays the Git branch names in the dialog when you perform a pull, merge, or rebase. The updated Files Merged with Conflicts dialog allows you to group files by directory, this will come in handy if there are multiple files merged with conflicts.

image12

Another area with loads of enhancements is the VCS Log tab, for a start it now allows you to open as many Log tabs as needed.

image1

You can now easily delete a Git tag from a commit right from the context menu of the Log tab.

image24

We’ve added the Favorite branches to the Branch filter in the Log tab, so you can now quickly filter commits by your favorite branches.

image38

Additionally, the Diff Preview Panel is now available in the VCS Log.

image19

Besides all that, if you use Git for version control, you can now explore the state of the repository based on any given revision. Using the new Browse Repository at Revision action which is available from the context menu in the VCS Log, or from the file history will open the required repository state in the Project Tool Window.

image2

image13

Also, while using the Commit and Push action in the upcoming IntelliJ IDEA 2018.2, it’s possible to skip the Push dialog completely, or to only show this dialog when pushing to protected branches. You can select these options in the Preferences | Version Control | Git.

image28

Now you can configure as many GitHub accounts as needed in the Preferences | Version Control | GitHub, and set the default GitHub account for each of your projects.

image16

Last but not least, the IDE now auto-completes Git tags in the Checkout dialog.

image35

Spring Boot

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.

Start your application, and Click the new Diagram Mode icon in the right gutter of the Beans tab in the Run Dashboard, and the IDE will display the Spring Runtime Beans diagram for the whole application.

image7

In the upcoming IntelliJ IDEA, 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.

image21

For GET methods you have the additional option to open a HTTP request in the browser.

image4

Web

  • React
    • New extract React component refactoring: Learn more.
    • Collection of code snippets for React: Learn more: Learn more.
  • Angular
    • Performance improvements for Angular projects: Learn more.
    • Run more Angular schematics using the Angular CLI integration: Learn more.
  • Vue.js
    • Completion for Vue events and event modifiers: Learn more.
  • JavaScript and TypeScript support
    • Support for TypeScript 2.9: Learn more.
    • Lots of new intentions: Learn more.
    • Customisable postfix templates for JavaScript and TypeScript: Learn more.
    • Find unused code in your client-side app with Code Coverage: Learn more.
  • New in the Node.js support
    • Support for Node.js on Windows Subsystem for Linux: Learn more.
    • Reconnect the debugger to the running node process: Learn more.
  • Unit testing
    • Rerun failed tests when using Karma, Jest or Mocha: Learn more.
    • Navigate to Jest snapshot: Learn more.

Scala:

  • The Scala plugin can show the places where you use Scala implicits. Moreover, the cases (errors) where you should use Scala implicits, but you are not, can also be shown in the editor. You can enable this new option via View | Implicits.
  • Move Refactoring: support moving members between objects.
  • Integrated the Scalafmt formatter. Can be enabled in Preferences / Settings | Editor | Code Style | Scala.
  • Semantic highlighting.
  • Improved auto-completion for pattern matching.

Groovy:

  • Support for the Groovy 2.5 annotations: @NamedDelegate @NamedParam @NamedVariant.
  • Support for the Groovy 3.0 default methods in interfaces.
  • Support for the do…while loop, try with resources, and method references ‘::’ .

We have some good news for Android developers too – the IntelliJ IDEA 2018.2 Beta includes the recent changes from Android Studio 3.1.2.

By the way, the Kotlin plugin bundled with the IDE has been updated to v1.2.50. Learn more.

Docker integration plugin

We’ve made several improvements in the upcoming IntelliJ IDEA 2018.2 with the Docker integration.

The updated Docker integration plugin now recognizes more command line options in the Dockerfile/Image run configuration: all the memory options, –security-opt, and the option to support GPU: –runtime=nvidia. Also, you can now use there the –rm option to launch a temporary container which will be automatically cleaned up after termination.

Another useful improvement in this area is the navigation from compose nodes and containers to the corresponding compose and Dockerfile files.

image9

With this update, we have added the new Use Soft Wraps action that wraps words in docker logs. This new action is available through the gutter icon in the Log tab of the Docker Tool Window.

image23

Now you can specify the base directory for executing a Docker build command for a dockerfile in the new Context folder field in the Docker run configuration.
By default, the Context folder field is set to the parent folder of a specified dockerfile.

image8

Well, that’s it for today, release notes for IntelliJ IDEA 2018.2 Beta can be found
here, and here are the release notes for the build.

Thank you for sharing all your feedback with us! We really appreciate it. Please continue to share your thoughts, suggestions, and bug reports ( if there are any) with us in the discussion forum, issue tracker, Twitter or here in the comments!

Download and try IntelliJ IDEA 2018.2 Beta!

image description