IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

Time:2020-9-29

Salute the tool maker. This paper has been published byhttps://www.yourbatman.cnIt includes spring technology stack, mybatis, JVM, middleware, etcspecial columnFor free study. Pay attention to the official account.Bat’s Utopia】Break through one by one, grasp deeply, and refuse to stop.

IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

preface

Hello everyone, I’m brother a. The last big version of idea was released in April
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
Nearly four months later, on July 28, 2020, Beijing time,IntelliJ IDEAThis is the second milestone in 2020.

As mentioned before, 2020 isJetbrainIt is reasonable to believe that some flags will be put up by the government. So since the official release of itsRoadmap in 2020After all, I have been paying close attention to it. After all, it is the 20th anniversary of the company on the one hand, and the “new decade” of the 21st century on the other. Such a good opportunity is very suitable for doing things.

Since the release of the last version (2020.1), many practical new features have been brought, such as:Chinese support, Zen mode, Javadoc renderingAnd so on. Some of the new features can significantly improve efficiency, so the response is very good. Coincidentally, as the second milestone version in 2020, what kind of expectations can it bring us?

text

As usual, let’s have a taste of the latest version of idea startup diagram:
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
I put2020.1The version startup diagram is also thrown here for you to compare, which is better?

IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

What’s new

The improvements made by IntelliJ idea 2020.2 focus onFull control of GitHub requests, including reviewing and merging GitHub PR in IDE. It also provides support for java15 and Jakarta EE 9, including quarkus, microaut, and so on.

1. Java 15 support

Although Java 15 will be released in September, IntelliJ idea 2020.2 has been prepared for this in advance, and its response should not be inflexible, so I would like to give it a big compliment.

Note: Java 15 new features are not mentioned in this article, after all, this is not the focus of this article

Digression:After jdk9Oracle has adopted a new release cycle: one release every six months and one lts release every three years. Jdk15 is the seventh version released after jdk9, which is still a non lts version. The latest lts version is jdk11 (jdk17 has not been released).
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

2. Embedded tips for related questions

This function is very easy to use, especially for some not usedRENAMEThe function of the small partner is the gospel.

If you haveExternal useThe IDE will use theMosaic tipsLet you know. Click the relevant embedded prompt, and the IDE will automatically open the find tool window for you, listing all the related problems in the external file.

After reading this paragraph, is it still a bit confusing? Come on, brother a has prepared an example for you:

Person.java Document:

public class Person {
    public String eat(String food) {
        return "SUCCESS";
    }
}

Demo.java Document:

public class Demo {
    public static void main(String[] args) {
        New person(). Eat ("big fish");
        New person(). Eat ("big meat");
    }
}

At this point, the compiler must be all right. Now I make a change: change theeat()The method name iseatDish()The results are as follows:
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
Click the prompt to automatically open the find box and locate the problem:
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
Just ask you, is this function cool, practical or not?

Tip: in the same.javaIn the file (even if it is a different class), there will be no similar prompt

3. Cause analysis of runtime exception

After listening to the function name, I think it’s very powerful. Quick positioning has always been a pain point for programmers. Now let tools help you to complete it, and your efficiency will be improved.

The new idea adds data flow analysis to exception stack trace analysis. When you click the stack trace, the IDE may take you to the exact location in the code where the exception occurred, andOffer suggestionsTo help you understand why this error occurred.

Let’s take an NPE exception as an example to feel it. The code is as follows:

public static void main(String[] args) {
    Integer i = null;
    System.out.println(i.toString());
}

Run the program and throw an exception. The console displays:
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
As shown in the red box, idea suggests that we create a breakpoint. Click this button to open the breakpoint creation dialog box
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
I have to say, it’s really convenient.

attach: a screenshot of the effect in the old version
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

4. Better stream API auto completion

Stream APIIn the development, the wife is too often used, so even if it is a little bit more intelligent, the efficiency improvement can be said to be great.

Can be directly in theCollection or arrayInput the stream API method name directly in the. Idea will be inserted automaticallystream()。 This applies to any stream operation (map, reduce, collect, and so on).

Voice over: you won’t have to write one more step manuallystream()Is it possible to open the forest

After a few words, let’s have a chestnut
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

attachThe effect of the old version of the screenshot, to contrast: it is obviously not supported at all
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

5. Live Templates new Java grouping

I believe that this is a pain point for many small partners. After all, we are Java programmersLive TemplatesAlmost 100% of it is targeted at Java code, and then the old version even returns itNo,Java group is really uncomfortable. I remember when I first started using IDEA, I silently make complaints about it.

Now, this version is finally added
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

Tip: what you put in the custom group is still there. It won’t be moved to you automatically

attachThis is a screenshot of the effect in the old version, which is used for comparison: there are JavaScript groups, but there are no Java groups
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
Special emphasis: this window is a new one. The old version does not have this capability and does not have this window. So, rise?

6. New problems window

This version of the new problems window, it is not too good.

displayRelated to the current fileWarning and error and problem description. In this tool window, you can right-click the problem and navigate to the code line that encounters the problem, so that you can repair it one by one.
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
In addition, it is in the fileUpper right cornerThe total number of questions and the up / down navigation buttons are very considerate
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

7. Preview of operation intention

At first glance, I thought that AI could preview my intention.

This feature allows you to actually apply them to your codebeforePreview their results. PressAlt+EnterCall the display context action and select the intention action you want, and then press the corresponding shortcut key to display the preview of the result (Ctrl + Shift + I on windows and Linux, ALT + space on Mac OS).

For example, the following code:

public static void main(String[] args) {
    List<Integer> ids = new ArrayList<>();
    
    for (Integer id : ids) {
        if (id > 10) {
            System.out.println(id);
        }
    }
}

Press forAlt+Enter
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
Press againCtrl+Shift+I(I’m windows), and you can see a preview of the results:
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

8. Improved spell checking

Idea uses the spell checker to check your spelling, and you can see that your words are correct. This improvement mainly improves the performance and accuracy. However, I usually disable this item. After all, sometimes I need to use pinyin for naming.

9. Full GitHub pull requests support

Now the entire GitHub PR workflow can be completedDirectly inIntelliJ idea completed. This includes browsing, assigning, managing, and merging PR, viewing timelines and inline comments, submitting comments, reviewing, and accepting changes.

In a nutshell, I don’t need a real case. Three pictures provided by the government are cited as examples
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
I would like to say that this functional area is absolutely for the workers who do java open source community developmentgospelYou can sleep more~

10. Improved git operation dialog

Mainly reflected inMerge, pull and rebaseThe visual consistency of the dialog box. In addition, the dialog box has been improved so that it can be clearly identifiedTo be implementedAnd add some missing options, such as to the pull and merge dialog boxespartAdded--rebaseand--no-verify
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

attach: a screenshot of the effect in the old version
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

11. Support for Jakarta EE 9

Jakarta EE 9, like Java 15, will be released in September this year, but idea has provided early support. And it claims to have supported all the available features of Jakarta EE (typical 13 technologies).

Digression: in early March 2018, Java EE was officially renamed as Jakarta EE,There is no more Java EE
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

12. Create enterprise project wizard

If you need to create a Java EE 8 or Jakarta EE 9 project, you can use the idea’s create wizard.
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
This seems useless for programmers in China, because we all use spring, so most of them use itSpring InitializrTo create a project.

12. Hprof memory viewer

We know that IntelliJ idea 2020.1 can be opened.hprofMemory dump files help identify memory leaks and find ways to optimize memory usage. At that time, the function was still very simple, and the idea official promised that it would continue to improve. Sure enough, this version brought the function improvement.

The following is a case study. The code is as follows:

public static void main(String[] args) throws InterruptedException {
    List<Integer> ids = new ArrayList<>();

    TimeUnit.MINUTES.sleep(10);
}

First use JPS to find your process ID (this will do, I won’t take a screenshot), and then use thejmap - dump:file=test.hprof , format = b your PIDGet a dump file:test.hprof
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
Then use this function of idea to read the file in:
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
After the file is read in, the analysis results can be seen in its “exclusive window”:
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

Point out the part of the code that uses a lot of memory and detect the cause of the memory leak. The hprof memory viewer displays the calculated object reserve size, the shortest path to the root of the garbage collector, the dominator tree of the object (reserved object), and the incoming references.

attach: a screenshot of the previous version (2020.1) to compare:
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
The new version still feels obviousFunction improvementYes. The last version of the official do not recommend you for production analysis, it is obvious that this version has no such words, use bar Sao Nian.

12. Using pre built indexes

Every time idea opens a project, it will index it to ensure the smoothness of coding in the subsequent process (code completion, code jump…), which is generally time-consuming.

The same project will be used and developed by more than n people. Can we just build itonceIndex, other people can use it directly? This version of idea provides support for this pain point.

Now, through theAnother machineInstead of building the index locally, the index file can be used to speed up the index.

Tip: this feature requires the installation of a shared indexplug-in unitProvide additional support

13. Can also be encoded in the index

When we open a project, if we are building an index, the color of the code is like this (indicating that the code should not be coded first, please wait)
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
Note: the color gray does not mean that you can’t type, just there is no code prompt

After the index is built, the color returns to normal, and you can code normally:
IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

Then in IntelliJ idea 2020.2, when building an index for your project, you can nowcontinueI’ve written the code. IDE can now provide java with code completion advice (the most important code completion hint capability) during indexing.

14. Support Maven wrapper

IntelliJ idea 2020.2 now supports the Maven wrapper, which automatically installs the required Maven version into your project. If a maven wrapper is provided and configured, the IDE automatically uses it and imports changes when needed.

What is a maven wrapper? Mm-hmm. I suggest you know it yourself~

15. Others

Others, such as yesJavaScriptLanguage code automatic completion support, database linked database UI / function optimization, Scala language support, etc. because there are not many people using it (mainly I don’t use it myself), so I won’t do a detailed explanation.

Of course, how much less cloud native technology is the new ideaDockerandKubernetesHow about optimization support? These are mainly reflected in the support of their configuration files, which you will feel in actual use.

Upgrade suggestions

rise

In the past, my suggestions were very conservative, but now they are just suggestions

About cracking

If you are a paying party (local tyrant), or open source committer, or edu email owner, please ignore this part ha.

  • If you upgrade to2020.2In the latest version, you can enjoy these new features to improve the coding efficiency. But,temporaryThere is no way to solve this problem. I also try it (I don’t believe it will not be solved after one month)

IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency

  • If you still decide to stay2020.1Even the previous version, then it can be cracked.The solution can be answered in the official account back stage “IDEA crack”.Let’s go~

summary

As the second version in 2020, although it is not as eye-catching as the new features provided by the first version (2020.1), many new features are still commendable and commendable.

Finally, we still want to pay tribute to those who have been tirelessly providing excellent tools for the IT industry!!! Especially the creators in Czechoslovakia, you have created very good tools to increase productivity,Promote the progress of some social industries, meritorious service!!!

I recommend you to read:
  • It’s time for fastjson to say goodbye
  • 1. Get to know Jackson — the best JSON Library in the world
  • 2. My God, this is how Jackson wrote JSON
  • 3. After understanding these, Fang dares to write JSON with Jackson on his resume
  • 4. How is the JSON string parsed? Jsonparser, find out
  • 5. It’s just jsonfactory factory. It’s quite unexpected

Focus on brother a

Author Your Batman
Personal site www.yourbatman.cn
E-mail [email protected]
WeChat fsx641385712
Active platform IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiencyIntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiencyIntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiencyIntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiencyIntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiencyIntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiencyIntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency
official account Bat Utopia (ID: bat Utopia)
Knowledge planet Bat’s Utopia
Daily article recommendation Daily article recommendation

IntelliJ idea 2020.2 officially released, many highlights, there are always a few can help you improve efficiency