Is it possible to use multiline todo's in IntelliJ IDEA?

前端 未结 7 1219
一整个雨季
一整个雨季 2020-12-15 02:06

If yes, how ?

If not, is there a workaround to get similar functionality ?

EDIT:

What I mean is something like this :

// TODO line1
         


        
7条回答
  •  半阙折子戏
    2020-12-15 02:53

    This regex works for me:

    (?:(?:todo|TODO)(?:\[[A-Z,a-z]+\-\d+\])?\s(\s*\b.*\b)*)|(?:\/\*\s*(?:todo|TODO)(?:\[[A-Z,a-z]+\-\d+\])?\s(?:(?!\*\/)[\s\S])*\*\/)
    

    It basically looks for the following:

    • A todo or TODO keyword optionally suffixed by a ticket/issue id in brackets and any amount of characters after a single white space character.
    • A java multi line comment starting with /* followed by any amount of white space and then the conditions outlined in the single line todo description above. It terminates once it finds */ in any of the following lines.

    Single-line examples:

    todo some very important stuff
    TODO[SAOY-1376] An urgent bug fix described in the SAOY-1376
    // todo some very important stuff
    // TODO[SAOY-1376] An urgent bug fix described in the SAOY-1376
    

    Multi-line examples:

    /* todo assignee or something
        a very important message
        another thing
    */
    
    /* TODO[SAO-13]
     * a very important message
     * another thing
    */
    

提交回复
热议问题