Search code examples
intellij-ideatodo

IntelliJ IDEA: Generate list of TODOs with Todo-text and according file


Is it possible in IntelliJ IDEA to generate a list of all todos, such that I have in each line of text the file and the todo-comment? I'd like to copy that information into an excel sheet for further processing.

The Todo Tool Window shows me a list, but I cannot copy that list without having a lot of additional information in my list (when I copy after expanding all entries of the list and marking them).


Solution

  • I don't think there is such feature in IntelliJ, however you can easily make a script to generate such file for you:

    egrep -nr '(TODO|FIXME|XXX)' src/ | sed -e 's/: */: /g' > todos.txt
    

    This will provide you plain text file with following structure:

    src/main/java/com/example/App.java: 11: // TODO: fix this
    src/test/java/com/example/AppTest.java: 20: // XXX: test
    src/test/java/com/example/AppTest.java: 32: // FIXME: test
    

    You can modify this basic command to tweak the structure of the output. For instance to generate CSV file which you can then open in Excel.