I’m trying to track TODOs in Android studio.
Is there a way to mark them ‘complete’ without simply deleting them?
The common convention is that when a
TODO is done, then you delete it from the code.
STOPSHIP might get picked up by CI servers and sets the build to failed until the comment is removed).
If you want to track progress of completed items, you have other tools available:
I extended the solution of setting a new pattern of
TODO by adding a MACRO to making the process automatic.
- At first we have to have set a new pattern for
TODOas I mentioned at the beginning.
Then we have to make a macro by executing the following steps:
- Go to: EDIT -> MACROS -> Start Macro Recording
- Since now your actions are recording by Android Studio. Set the cursor on the “TODO” word and press: Left Alt + J // FOR MAC OS X: Ctrl + G / Shift + Ctrl + G (TODO word will be highlighted)
See the screenshot #1
- Now press the CAPS LOCK key button to turn on CAPS LOCK (or use SHIFT button instead of CAPS LOCK for typing capital letters)
- …and type COMPLETED (or other word which you used in your own TODO pattern)
See the screenshot #2
- Now press the CAPS LOCK key button again to turn off CAPS LOCK (or release the SHIFT button)
- Go to: EDIT -> MACROS -> Stop Macro Recording
- Enter a name for your macro
See the screenshot #3
Go to: FILE -> SETTINGS -> KEYMAP (If you can’t find it, use the search field)
See the screenshot #4
Add your own Keyboard Shortcut
See the screenshot #5
THAT’S ALL! Set the cursor on
TODOword in your code and press your preselected shortcut.
in the -> settings/editor/todo and follow the steps