Chuanxin IDEA 2020.1 really fragrant experience! Chief Productivity Officer, Java Development

Just a few days ago, the new version of Java software development artifact IDEA 2020.1 was released:

image

I updated and experienced it for a few days on the machine for the first time, and it still feels a bit fragrant! What's the matter? After experiencing the new features, I can't help but sigh: IDEA is really getting smarter and more understanding of developers now.


UI / interface upgrade

1. The interface supports Chinese

The effect after being finished in Chinese is this simple look:

image

Every flower comes into its own eyes, no good or bad judgement, you can adjust it according to your preferences.

It must be said that this Chinese localization is not natively supported by the software, but needs to download and install a Chinese (Simplified) Language Packplugin called , fortunately this plugin is JetBrainsofficially provided

image

2. The evolution of the navigation bar

Now the code level navigation bar can directly locate a specific method or field in the file, this is indeed very efficient

image

3. Support Javadocsrendering in the editor

It used to be Javadocvery inconvenient to read in IDEA , because the original state Javadoccontains various marks, which is not easy to read. This new version of IDEA 2020 has a new Javadocsrendering function that can be enabled by clicking the small button on the left

image

After rendering, Javadocit is very intuitive and easy to read, and you can also adjust the font size

image

4. New themes and fonts

First of all, it supports its JetBrainsown new JetBrains Monofont by default . This is nothing to say. I have experienced it before. For details, please refer to the previous article "Test Water JetBrains Official New Programming Font, Really Fragrant!"

image

Then the unified IntelliJ Lighttheme is adopted , and the theme has been completely unified in different operating systems

image

image

Do you like to see everyone's personal habits?

5. The ship's new LightEdit mode

LightEdit, As the name suggests, lightweight code editing.

Yes, this updated IDEA supports opening a single code file for editing without opening the entire project. The file can be opened in a separate editing window, and this window can coexist with other (project) windows. like this:

image

More powerful is that it directly supports the quick opening of the complete project where this single file is located:

image

You can even open a single file through the command line, which is quite ok:

image

6. Support "Zen" mode

The current code display mode is rich enough to support four types:

image

Of course, the Zen mode is the most thorough. As soon as you open this mode, the whole world is clean ...

image

7. The terminal supports columns

Now you can arbitrarily divide the terminal that comes with IDEA into columns, which is very convenient

image


Support direct installation of JDK and Git in IDEA

Many small partners communicated that their JDK environment seems to have problems, and there are problems in various experiments. For this matter, obsessive-compulsive disorder is almost committed, very annoying.

Starting from IntelliJ IDEA 2020.1, we can directly download and set up the JDK environment from IDEA when creating a project, which is very convenient.

I specially experimented, and downloaded and installed an Open JDK 14 in IDEA. No problem, easy to use, and switching is also very convenient.

image

image

In addition, IDEA also directly supports the installation of Git.

image


Support Java 14 new features

Some time ago, Java 14 was released, and some new features were added. This time IDEA 2020.1 quickly followed up and supported some of the new features of Java 14. Here are two typical examples.

1. instanceofUsage enhancement

In the old Java version, we generally use instanceof syntax like this:

private void test( Object obj ) {
    if( obj instanceof String  ) {
        String str = (String) obj;  // 需手动强制转换!
        System.out.println( str.isEmpty() );
    }
}

And Java 14 has instanceofenhanced the usage. With the help of a new one IDEA 2020, we can quickly restructure the above code as follows:

image

So eventually it became this sub-child:

private void test( Object obj ) {
    if( obj instanceof String str ) { // 校验通过,直接后面定义变量,无需强转!
        System.out.println( str.isEmpty() );
    }
}

2. recordNew grammar support

Java 14 added a recordnew syntax, recordthe lexical meaning "record" , mainly used for fixed record formalized, it is mainly through before the immutable class to achieve, give you an example.

For example, we define an immutable log record class LogRecord, which contains log ID ( id), log time ( date), log details ( detail), according to the old practice, can only be used classto define:

public final class LogRecord { // 不可变类

    private final int id;
    private final LocalDate date;
    private final String detail;

    public LogRecord(int id, LocalDate date, String detail) {
        this.id = id;
        this.date = date;
        this.detail = detail;
    }


    public int getId() {
        return id;
    }

    public LocalDate getDate() {
        return date;
    }

    public String getDetail() {
        return detail;
    }

    @Override
    public String toString() {
        return "LogRecord{" +
                "id=" + id +
                ", date=" + date +
                ", detail='" + detail + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LogRecord logRecord = (LogRecord) o;
        return id == logRecord.id &&
                Objects.equals(date, logRecord.date) &&
                Objects.equals(detail, logRecord.detail);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, date, detail);
    }
    
}

Java 14 think above this finaltype classdefined routines are completely fixed, fixed routines written a lot of code, including: constructor, Gettermethod, toString()methods, hashCode()and equals()methods, etc., very boring.

To this end, Java 14 introduced a new recordsyntax, which can be done with just one line of code, which is very convenient:

record LogRecord( int id, LocalDate date, String detail ) {
    
}

This time, IDEA 2020 already fully supports recodgrammar, and can also automatically recordgenerate various methods for explicit :

image


Support more intelligent inspection and reconstruction

1. Support local method change signature

What does that mean? for example.

When you want to directly modify the parameters of an existing method, no matter 3, 21, 21, you can directly modify the method signature, and then click Update, all the next steps IDEA can help you complete.

image

image

image

image

2. Intelligent analysis of date string format

For example, in this example, when I formatted a date, I accidentally yyyy/MM/ddwrote the year, month, and day strings yyyy/mm/dd, and MMforgot the upper and lower case, IDEA automatically analyzed it for us:

image

3. Smart grammar and spell checker

This feature must Graziebe used in conjunction with this plugin, which is a comprehensive grammar, spelling, and style checking tool.

For example, I shook my hand at this place and wrote the wrong English grammar, and it prompted us immediately

image


Enhanced debugging

1. The data flow analysis assistant can directly predict the following operation results

IDEA 2020.1 directly adds data flow analysis to the JVM debugger. When the program stops at the breakpoint, IDEA can run data flow analysis based on the current state of the program to predict what will happen next.

image

2. Supports fixed object fields when debugging

When an object has too many fields, so that it is difficult to find the required field during debugging, we can directly put it on the top for easy viewing.

image

3. Store the running configuration in the form of a file

The new version of IDEA supports directly archiving the current debugging / running configuration and choosing to reload it later

image


More advanced version control

The first big improvement is to redesign the code submission window, instead of the old modal pop-up window. In this way, when the code is submitted for comparison, the editor will be more comfortable.

image

The second improvement is to support searching , refreshing local and remote code branches:

image

In addition, leaving traces in this historical log is pretty good:

image


Maven and Gradle import updates

Take the Maven tool as an example here, a floating notification appears in the upper right corner of the editor. After modifying the build file, you can use this mini notification icon to load the changes.

image


Database processing enhancements

The new version of IDEA's built-in database management can now support exporting data to a Excel(.xlsx)file, and directly view it as text in the editor

image


Enhanced HTTP Client

After the upgrade, it is HTTP Clientmore intelligent, typical examples are: support for automatic matching and completion

image

And you can also Contollerautomatically generate HTTP request files on the left side of the code in a quick way

image

And for the Spring project, you can also Endpointsquickly generate HTTP request files in the bottom window.

image


Other improvements

1. Support and improvement of various frameworks, such as: Spring WebFlux/Selenium/JMS/Micronaut/RxJavaetc.

2. Docker/KubernetesSupport improvements

3. Scala 3Support

4. Android VolleySupport

5. JavaScriptImprovement and support


summary

After some experience, I found that the new version of IDEA 2020.1 has many visual improvements, which are quite fragrant.

However, there is another practical problem: after I upgraded, I found that a large number of plugins were not available, so the compatibility of peripheral support had to wait.


Published 85 original articles · praised 1854 · 180,000 views +

Guess you like

Origin blog.csdn.net/wangshuaiwsws95/article/details/105528959
Recommended