robcowie / SublimeTODO

**[DEPRECATED]** - See https://github.com/jonathandelgado/SublimeTodoReview - Extract TODO-type comments from open files and project folders
295 stars 54 forks source link

Support for TODO Priority #16

Open imperez opened 12 years ago

imperez commented 12 years ago

I was thinking it would be good to have some sort of support for priority in TODOs. I was thinking when you write a TODO you do something like this:

TODO: (HIGH) This is a very important todo

TODO: (HIGH) This is another very important todo

TODO: (LOW) This is a not so important todo

Then when you list your TODOs the list would be organized with priority in mind.

TODO (3)

HIGH

  1. This is a very important todo
  2. This is a very important todo

LOW

  1. This is a not so important todo

It would help give more of an idea of what TODO should be focused on more especially as the file gets large.

erinata commented 12 years ago

I think you can put

"patterns":
{
    "TODO(HIGH)": "TODO\\(HIGH\\)[\\s]*?:+(?P<todohigh>.*)$",
    "TODO(LOW)": "TODO\\(LOW\\)[\\s]*?:+(?P<todolow>.*)$"
}

Into the Preferences.sublime-settings file.

In this sense you can have

# TODO(HIGH): This is a very important todo
# TODO(HIGH): This is another very important todo
# TODO(LOW): This is a not so important todo

And it will yield

## TODOHIGH (1)
1. This is a very important todo
2. This is another very important todo

## TODOLOW (1)
1. This is a not so important todo

Not exactly the pattern you want but as the pattern you require is overlapping with the original TODO pattern, I cannot overwrite it.

( However I am not using them because typing (HIGH) and (LOW) is too much typing for me. I would rather use the pattern "TODO\\![\\s]*?:+(?P<todoimportant>.*)$", which response to #TODO!: this is an important task. I am just lazy :P )

robcowie: Would it be possible to move the "core task" in your python file to the sublime settings file? So people can totally redefine all tasks without modifying your python code?

imperez commented 12 years ago

Great idea. I'll use that method since it does work as a good compromise. Thanks!

Jamesking56 commented 11 years ago

I would really love this feature too