简体   繁体   中英

What does this annotation in Intellij source code mean?

When looking into the source code of IntelliJ IDEA Community Edition project in github, in one of the files I found the following notation:

void m() {
    <selection><caret>System.out.println("");</selection>
}

What does this <selection> annotation mean? By which tool is it being processed?

The complete source of afterEnumConstantWithArgs.java is as follows.

// "Use existing implementation of 'm'" "true"
enum I {
    A("a") {
        void m() {
            <selection><caret>System.out.println("");</selection>
        }
    },
    B("b") {
        public void m() {
            System.out.println("");
        }
    };
    abstract void m();
    I(String s){}
}

Firstly you should note you're reading test data , not a source file itself. Presumably this is emulating a file that would be loaded into IntelliJ.

<caret> would be referring to where the caret is in the file, ie the blinking cursor. <selection> would be the code that's currently selected, which is why it has a beginning and end tag.

Source: reading the code until I figured this out.

Seems to be parsed by this file .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM