📜 ⬆️ ⬇️

IntelliJ IDEA 13.1: Spring Update

Hi, Habr!

Together with the good news for the Northern Hemisphere that the length of daylight hours has increased, we want to talk about the release of IntelliJ IDEA 13.1, which happened this week. But before the story about the updates, I would like to mention one more event that was highly expected by the entire Java community ...


')
Of course, the release of Java 8. In version 13.1, we have provided full support for Java 8, so you can fully work with the latest edition of the language now, in a familiar IDE for you.


JAVA 8


The attentive reader may have noticed that already in previous versions of IntelliJ IDEA there was “preliminary” support for Java 8. For example, support for debugging projects using anonymous classes and lambda functions was added already in version 13.

Now, new inspections and auto-completion of the code will allow you to work fully with Java 8. Let's take an example of how to use new inspections to quickly transfer your code to the new Stream API:

image

The IDE helps determine which method is used for your lambda expression by clicking on the interface icon in the left margin of the editor.

If you want to make the appropriate edits in more than one place of your project, then you can run the appropriate inspection (“ foreach loop can be collapsed with stream api ”) on the entire project (or in another given context) via Analyze → Run inspection by Name .

image


MULTIPLE SELECTIONS


One of the important features that we added to the latest versions of IntelliJ-based IDE was the function of multiple selection (known as Multiple Selection , Multi Carets and Multiple Cursors). Multiple Selection allows you to make changes to the code in several places at the same time, a similar function today is in Submlime Text and some other editors.

How it works:


Multiple selection works great with other code editing features IntelliJ IDEA: Code completion, Select word at care, Join lines, Copy / paste, and others:

image

This feature won the most votes in our tracker .


POSTFIX CODE COMPLETION


Another important feature that appeared in version 13.1 is postfix code completion or postfix code completion . With it, you can replace one expression (which you have already entered) with another, depending on the postfix you add. The function is useful precisely if you have already entered something and now you would like to change this expression without returning and changing the code.

For example, if the postfix “.if” is added to the logical expression, it will automatically be wrapped by the if branch, and the cursor will move to the operator's body. Similarly, “.notnull” wraps around with a null-check construct.

image

Thus, postfix completion allows in smaller cases to move the cursor in the opposite direction, saving you time.


NASHORN DEBUGGER


For those who plan to use Nashorn runtime (about what it can be read in other habrostatyah ) to run JavaScript in their applications, it will be useful to learn about the new features of the IntelliJ IDEA debugger. Now you can set breakpoints and move between them, even if you marked the lines in JavaScript. In addition, if JavaScript refers to an object from Java, the debugger will move to Java code and back to the script, depending on the code sequence and the breakpoint set:

image

More details about debugging projects with JDK8's Nashorn JavaScript can be found in our blogpost .


CHRONON “BACK-IN-TIME” JAVA DEBUGGER


IntelliJ IDEA 13.1 Ultimate edition has got another very useful plugin for integration with Chronon . With it, you can record the execution history of the program, and then it is very convenient to view it by moving through the code and looking at the field values ​​at each moment of a specific method call. This makes the search for “complex” bugs more efficient:

image

Chronon is a commercial product. However, IntelliJ IDEA Ultimate users can use it completely free of charge in the IDE. How to add a plugin and details of its use can be found here .


ANGULAR-JS, SPY-JS, LIVE CONSOLE



AngularJS

In the latest version of IntelliJ IDEA, we also expanded support for the AngularJS framework.



image

Spy js

Spy-JS is a powerful JavaScript tracing tool. With it, you can view the full list of events, open the call tree and the highlighted code execution path. You can also view the stack trace for a selected section of code, filter scripts and events, monitor the performance of the code. Spy-JS is adapted to work on any stationary and mobile browsers, allows you to effectively profile and debug code.

image

More information about SPY-JS can be read in habrostat .

Live console

With console, the reader is most likely familiar with debugging in the browser, but now this feature is also available in the IDE when debugging a web page. In the console, you can execute commands and run javascript.

image


WHAT ELSE?



More information on the list of new features can be found at www.jetbrains.com/idea/whatsnew/index.html

You can download the new version - you know where: http://www.jetbrains.com/idea/download/

Program with pleasure!

Source: https://habr.com/ru/post/216667/


All Articles