Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put TODO comments in xml?

Tags:

I was wondering if there is a way to comment parts of xml code in android so they would later show up in TODO list in android studio? I am using android studio 0.8.2.

like image 405
Markonionini Avatar asked Sep 14 '14 16:09

Markonionini


People also ask

How do you put comments in XML?

The syntax for adding XML comments in your code is triple slashes /// followed by one of the supported XML tags. There is IntelliSense support for writing documentation comments.

How do I add a comment todo?

To create a TODO commentPlace the caret where you want to create a TODO item and add a comment, for example, by pressing Ctrl+/ , then type TODO or FIXME , and then type your note. View the list of TODO items in the TODO tool window.

How do I comment out a block of code in XML?

If you are using Eclipse IDE you can comment out lines in an XML file by highlighting them and press Ctrl+Shift+c.


2 Answers

You can use XML comments <!-- ... --> with TODO tags, e.g.

<!-- TODO remember the milk -->

Note that XML comments need to be at the tag level, that is

<!-- TODO ... -->
<SomeElement .../>

and not inside the tag like

<SomeElement <!-- TODO this won't work --> />
like image 55
laalto Avatar answered Sep 17 '22 23:09

laalto


XML TODO comments are now visible afterwards Android Studio 3 in TODO list. To use them you can use it like below:

<!-- TODO Pending task -->
<android.support.v7.widget.CardView

Make sure to use it above Element/View in XML and not in-between.

See below image showing usages

like image 37
Rahul Khurana Avatar answered Sep 19 '22 23:09

Rahul Khurana