mikaeljorhult / brackets-todo

Brackets/Edge Code extension that displays all TODO comments in current document or project.
144 stars 37 forks source link

Support * @TODO: #46

Closed grappler closed 10 years ago

grappler commented 10 years ago

Hi, the extension is not recognising this format * @TODO:

From a bit of guess work I would say that by adding *\ it should work. (?:\\/\\*|\\/\\/|#|\*) *@?( but I could not get it to work.

https://github.com/mikaeljorhult/brackets-todo/blob/master/modules/Defaults.js#L13

grappler commented 10 years ago

This must be why it does not work also.

Please note that multiline comments will not work. Todo will only return the first line of the comment.

It is a shame. I would love to see this feature.

mikaeljorhult commented 10 years ago

Yes, that's why you're not seeing the todos. I'll see if there's any way I can make it work. It might be a bit slower but I might be able to make it work.

grappler commented 10 years ago

That would be great and really helpful.

mikaeljorhult commented 10 years ago

Sorry for the delay but I finally got some time to try this out this evening. If you create a .todo file in your project root directory and add the following code it will work.

{
    "regex": {
        "prefix": "(?:\\/\\*|\\/\\/|#|\\*) *@?("
    }
}

The important part is that all backslashes need to be escaped as the JSON strings i read by JavaScript which will try to escape the values. Double backslashes becomes single backslashes.

grappler commented 10 years ago

It works!!! :smile: Thank you very much! The reason to apologise you are doing me a favour.