days
-1
-3
hours
0
-9
minutes
0
-5
seconds
-3
-4
search
The wait is over

Fresh out of the JetBrains oven: IntelliJ IDEA 2018.2 & GoLand 2018.2 are here

Gabriela Motroc
IntelliJ IDEA
© Shutterstock / Africa Studio

Pop the champagne, IntelliJ IDEA 2018.2 is here! And so is GoLand 2018.2. Let’s see what’s on the menu.

No rest for the JetBrains team!  The second Release Candidate of IntelliJ IDEA 2018.2 was released last week and now the new major update is here.

It arrives with a lot of interesting improvements and features but the most important is probably the Java 11 support. In short,  IntelliJ IDEA 2018.2 is ready for the next Java version (due to arrive in September).

Let’s have a look at what’s new in IntelliJ IDEA 2018.2:

Java: IntelliJ IDEA 2018.2 is ready for Java 11

  • We already mentioned that IntelliJ IDEA 2018.2 brings support for Java 11. Local-variable syntax for lambda parameters [according to the JEP 323] is now supported, which means you can use the var keyword in lambda expressions.
  • You can also view data flow information in the editor now. All you have to do is invoke the Expression type action (Ctrl+Shift+P) a second time.
  • From now on, seeing the type of each call as a type hint for long method chains with generics won’t be a problem as the IDE displays type hints for long method chains.
  • You can now configure Quick Documentation to pop-up together with autocompletion. All you need to do is enable the Show the documentation pop-up in… option in Preferences/Settings | Editor | General | Code Completion.
  • The new major update introduced a new preview panel for the Extract Method refactoring. This basically means you can see what the results of your refactoring will look like, before confirming the changes. The new preview panel will come in handy when you refactor code fragments with duplicates.
  • As you well known, IntelliJ IDEA supports the @Contract annotation, which means you can 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, as explained in the announcement. In the new major update, the @Contract annotation has been extended to support 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.
  • The Join Lines action (Ctrl+Shift+J on Linux/Windows/macOS) is on the “upgraded” list. Now, on any method call where the return type is the same as the qualifier type, the action will merge multiple method calls into a chained call. This also works on a declaration or assignment line with a subsequent call. Also, the action produces a cleaner result with a nested if, and when you are joining lines with an unnecessary 0.
  • Support for Stream API has also been improved. As of 2018.2, it is able to detect sorted streams that collect an unsorted collection. This indicates that either the sorting is unnecessary or that using the collector or collection is wrong. There’s also a new warning about a redundant distinct() call before collect(toSet()), because when collecting to a Set, the result is always distinct anyway.

Editor

  •  Tab will help you jump outside the closing bracket or quote; if you want to enable this Tab behavior, you’ll have to go to Preferences/Settings | Editor | General | Smart keys and select Jump outside closing brackets/quote with Tab. By the way, this works in Java, Kotlin, Groovy, SQL, PHP, JavaScript, and Python files.
  • IntelliJ IDEA now underlines reassigned local variables and reassigned parameters, by default. You can change the attributes for all the languages supporting this feature [including Java and Groovy!] in Preferences/Settings | Editor | Color Scheme | Language Defaults | Identifiers | Reassigned.
  • Last but not least, when you place the caret at the break or continue keyword, the IDE will highlight the for or while keyword of the corresponding loop.

User interface: New icons are here!

  • The new major update arrives with support for the MacBook Touch Bar in tow! This basically means you can run, build, and debug your project, commit changes, and update the project right from the Touch Bar. One more thing: you’ll find the IDE buttons 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. Have we mentioned that you can customize all available Touch Bar contexts on the Touch Bar page? Go to Preferences | Appearance & Behavior | Menus and Toolbars.
  • If you wanted dark window headers, you’ve got them now! You can now make the IntelliJ IDEA title bars darker on macOS. Here’s how: go to Preferences | Appearance & Behavior | Appearance and select Use dark window headers.
  • Speaking of new and exciting, the new icons are here! Their goal is to reduce visual clutter and ensure better readability.
  • And since the icons have been changed and everything is modern, something had to be done about the IntelliJ theme on Linux. The appearance of UI elements such as buttons, radio buttons, checkboxes, text fields, select controls, spinner, and tabs have been updated.

JVM Debugger

  • If you want to debug Java projects, you should know that IntelliJ IDEA 2018.2 includes several new handy breakpoint intention actions. You don’t have to set up the properties of a particular breakpoint by hand anymore – all you have to do is press Alt+Enter and the IDE will give you the new breakpoint intentions, along with all the other available intentions.
  • You can now stop at a breakpoint if a certain condition applies to the call stack. The new Caller filter allows you to only stop at a breakpoint if it’s called from the specified method. It also works the other way round: it will not stop at a breakpoint if it’s called from that method.

Gradle

  • Gradle’s buildSrc sources and their usages are linked in a build, which means you can now navigate from the build scripts to the buildSrc source.
  • Remember when you could debug a build.gradle file only as a Groovy script? That’s not the case anymore: you can now debug a Gradle script in IntelliJ IDEA. With IntelliJ IDEA 2018.2, you can now set a breakpoint not only at the top level of the Gradle build script but also in the Gradle DSL blocks.

Kotlin

  • As of IntelliJ IDEA 2018.2, you can run Kotlin Script scratch files and see the results right in the editor. What’s more, Kotlin Script scratch files can use the declarations from the code in the project and it’s now possible to create new Kotlin Script scratch files right from the Project view.
  • There’s a handy intention via Alt+Enter to convert end-of-line comments into block comments, and vice versa.
  • Support for kotlinx.coroutines has been improved: the IDE now reports unused Deferred results.
  • The IDE detects redundant async calls that are immediately followed by an await call, and suggests two new intentions to merge the call chain into kotlinx.coroutines.experimental.withContext:
    • async {}.await() to withContext(DefaultDispatcher).
    • async(ctx){ }.await() to withContext(ctx) { }.

JavaScript & TypeScript: Add new features to your Angular app using the integration with ng add

  • You can now use the new Extract Component refactoring to create a new React component, by extracting the JSX code from the render method of an existing one. You can also сonvert React class components into functional components, and vice versa, by using new intentions.
  • If there’s unused JavaScript code (or TypeScript code) on your client-side, you will find it easier thanks to the new Code Coverage feature. What you need to do in order to take advantage of this feature is to start a JavaScript Debug configuration with coverage in the IDE and interact with your app in Chrome. Then stop the configuration, and IntelliJ IDEA will show you the coverage report in the Coverage tool window. Easy peasy.
  • It’s now possible to add new features to your Angular app,  thanks to the integration with ng add. To install libraries that support installation with ng add without using the terminal, you’ll have to use the New… | Angular Dependency… action. If you want to generate the code with Angular schematics, you’ll have to use the New… | Angular Schematic… action.
  • Lots of new JavaScript and TypeScript intentions are now available when you press Alt+Enter: Implement interfaceCreate derived classImplement members of an interface or abstract classGenerate cases for ‘switch’, and Iterate with ‘for..of’.

Spring integration

  • IntelliJ IDEA 2018.2 supports Spring Integration 5.0 but that’s not all: there’s also a new Spring Integration Diagram which visualizes the components in the system; it shows the gateways, channels, bridges, etc. that have been configured for the application using XML or Java annotations.

Spring Boot

  • You can now select the new Diagram Mode option and see 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. The IDE will display the Spring Runtime Beans diagram for the whole application.
  • Manage your HTTP requests mappings from the Run Dashboard in IntelliJ IDEA 2018.2. After you run your application, you’ll have to select the request you need from the Mappings tab, and then either run your HTTP request straight away or open it in the editor-based REST client. Keep in mind though that for GET methods, you have an additional option to open a HTTP request in the browser.

Docker

  • The Docker plugin allows you to navigate from compose nodes and containers to the corresponding compose and dockerfile files.
  • There’s also a new Use Soft Wraps action for wrapping words in Docker logs. You can access it via the gutter icon in the Log tab of the Docker Tool Window.

We’ve only scratched the surface so if you want to see all the goodies in IntelliJ IDEA 2018.2, go here and here

Let’s have a look at what’s new in GoLand 2018.2:

  • GoLand 2018.2 arrives with a lot of interesting improvements and features but the most important is probably the integration with go modules (vgo) out of the box. Read more about it here.
  • The Move refactoring has received a new dialog which shows whether an identifier is needed, as well as an ability to move symbols across packages.
  • Convert to expected type [a new quick-fix] converts a value to the desired type whenever the language permits.
  • A new Implement missing methods quick-fix allows you to add missing methods fast and painlessly if the expected type is an interface.
  • Implement Methods is all grown-up; in addition to adding methods from an interface to a chosen type, it can now create this type right away.
  • You can now disable leading spaces for annotations that start with certain prefixes: Add leading space to comment in Settings | Editor | Code Style | Go | Other.
  • The debugger supports non-suspending breakpoints and lazy-loading for arrays, maps, and slices; supports deep nesting in maps; and offers a better presentation of key-value pairs in maps and slices.
  • As far as user interface is concerned, Touch Bar support has been added, as well as new option Use dark window headers. Last but not least, there are new icons on the IDE toolbar and tool windows.
  • GoLand 2018.2 arrives with TypeScript 2.9 support in tow. This is also the case for the upcoming TypeScript 3.0 releases. This major summer update also includes new intentions, namely Implement interfaceCreate derived classImplement members of an interface or abstract classGenerate cases for ‘switch’, and Iterate with ‘for..of’ and you can now find any unused code in your project with the new Code Coverage feature.

We’ve only scratched the surface so if you want to see all the goodies in GoLand 2018.2, go here and here

Author
Gabriela Motroc
Gabriela Motroc is editor of JAXenter.com and JAX Magazine. Before working at Software & Support Media Group, she studied International Communication Management at the Hague University of Applied Sciences.

Leave a Reply

2 Comments on "Fresh out of the JetBrains oven: IntelliJ IDEA 2018.2 & GoLand 2018.2 are here"

avatar
400
  Subscribe  
Notify of
Nithiin arora
Guest

Thanks for sharing this in here. You are running a great blog, keep up this good work.