Idea_ file-level comments & custom Live template similar to Sout

Source: Internet
Author: User
Tags foreach comments
1. File Comments effect

Set

File->setting->->editor->file and Code templates settings
2. Method Notes Overview

Using the Eclipse shortcut key people may not be accustomed to, Sysout, foreach and other shortcuts can not be found, the main method can not be automatically complete, in fact, this in IntelliJ has an exceptionally powerful module live template to achieve.
For example, if you try to psvm+tab in class, you will see that the main method is generated, and input iter+tab, and a foreach statement is generated. The live template also has a surround usage, select a variable, type Ctl+alt+j two times, and an auto-complete menu appears. In addition, you can customize the live Template. Code Snippet Technology application is also very common, IntelliJ Live template advantage is built-in some intelligent variables and functions, you can do some semantic level analysis and application of the detailed explanation 1. Create your own switch template 1.1 file->setting->live Template

1.2 Creating your own template code group

1.3 Creating your own code templates

Switch ($VAR $) {case
    $VAR _children$: Break
        ; $END $
}

1.4 Some configurable items in the code template



Using Swit in code, you can use 2.foreach template parsing 2.1 Java code

2.2 The configuration in live template


1. The default is to edit Mdatas first because in the variales of the iter template, Iterabletype iterable_type on top
2. Ability to search for the nearest Mdatas as the default value, which is the function of Expression-iterablevariable () in Edit variales
3. Suggestvariablename () Let the developer enter the variable name, other parameters also have the corresponding function, refer to the following URL template variable function in detail such as iterablevariable (), etc.

Http://www.jetbrains.com/help/idea/2016.1/edit-template-variables-dialog.html?origin=old_help#functions Reference Documents

http://blog.csdn.net/kiwi_coder/article/details/17575629

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.