mrodalgaard / atom-todo-show

Atom package that shows a list of todos from your project.
https://atom.io/packages/todo-show
MIT License
182 stars 30 forks source link

Improvements for tags: Allow non-ASCII characters; allow tags anywhere in the line #203

Open ThomasLandauer opened 6 years ago

ThomasLandauer commented 6 years ago

First of all: The idea to allow tags to organize TODO's is excellent! I've never seen this anywhere else.

A few ideas to improve tags:

  1. Currently, only ASCII characters are allowed in tags, which is a problem for certain languages (e.g. German). The reason is \w at https://github.com/mrodalgaard/atom-todo-show/blob/master/lib/todo-model.coffee#L66 which only accepts "word characters". However, this could be solved by making the regex-engine locale-sensitive - at least http://www.php.net/manual/en/regexp.reference.escape.php says so. Do you have an idea how this could be achieved?
    Or what about taking another approach and consider basically anything prefixed by # as a tag, something like #[^#\s\.,]+

  2. Is there a specific reason why tags are only allowed at the end of the line? More general: Is there any reference for the "tag" syntax you're using?
    If you would omit the $ from the regex, tags would be possible anywhere: "TODO: #object #profile do this"

  3. Minor: I sometimes add an URL to a TODO for later reference. If the URL contains an html anchor (like e.g. www.example.com/foo.html#bar ), the bar part is extracted as a tag.