How to create TODO filter?

In our source code we have lot's of comments that use following pattern:

@todo v2.1 Todo comment

How can we create version specific todo filters? I tried regex "\btodo v2.1\b.*" and similar variations that work when testing with http://www.regexr.com/, but I get 0 results when using this pattern in PhpStorm.

6 comments

Hi there,

I assume you want to create TODO pattern .. as TODO filter is just a colection of existing patterns.

This one works just fine for me:

\btodo v2\.1.*


screen01.png

screen02.png

0

Thanks for the quick and detailed response. Yes, I was talking about TODO pattern, but your example didn't work for me. Notice that for some reason it shows 6 results using "Show All" filter, when there are only 3 tasks and 0 results when I select v2.1 or v3.0 filter even though each has one task. By the way, I'm using PhpStorm EAP, build # 138.379



Attachment(s):
ps3.png
ps2.png
ps1.png
0

Worsk for me (using  the same EAP build 138.379).

But it seems to only work in "Current File" tab and not in "Whole Project" or "Scope Based"

screen01.png


screen02.png

Notice that for some reason it shows 6 results using "Show All" filter,


Yeah .. it happens from time to time. This is because generic (first one) pattern is also counted (which means -- the same todo entry can be counted multiple times)

I may only suggest to file a Bug Report ticket to the actual Issue Tracker ( http://youtrack.jetbrains.com/issues/WI ) and let devs to look into int.

0

Thanks Andriy, it actually started working for me on that small sample file I created after logging out and logging back into my PC (perhaps delay in indexing?), but then I tried it on "Scope Based" search and again received 0 results, went back to sample file and it stopped working as well. So it looks like "Scope Based" custom TODO pattern issue could be reproducable, I'll submit new ticket.

0

It seems to me that the problem is with TODOs defined via PHPDoc (e.g. /** @todo v2.1 bla bla */), because if it's defined via "normal" line or block comment (e.g. //TODO v2.1: bla-bla or /* @todo v2.1 bla-bla */) it works OK.

0

Please sign in to leave a comment.