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

前端 未结 7 1150
一整个雨季
一整个雨季 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:59

    Building on NonGrate's answer:

    Go to settings, search for TODO settings, and replace the existing todo entry "\btodo\b.*" with:

    (\btodo\b.*)|(\/\*(\*(?!\/)|[^*])*\btodo\b(\*(?!\/)|[^*])*\*\/)
    

    Result:

    You must use */ to close the highlight.

    It uses 2 patterns:

    1. (\btodo\b.) captures any line with the word todo
    2. (/\*(\*(?!/)|[^*])*\btodo\b(\*(?!/)|[^*]*\*/) captures multi line comments starting with /* and ending with */

    Any other combinations may not work.

    Note: You have to replace the existing regex to avoid having multiple instances of the same todo item appearing in the todo list.

    0 讨论(0)
提交回复
热议问题