Hacker News new | past | comments | ask | show | jobs | submit login

Nice idea. The JetBrains family of IDEs (RubyMine, IntelliJ, etc.) even have this as a built-in TODO panel that shows files with TODO and FIXME comments (syntax is configurable).

I use IntelliJ as well for years, but don't underestimate

   grep -r "# TODO" .

That’s great! Using ripgrep [1], I think it would even exclude all from your .gitignore by default.

I’ll give this a try before adding something to my .vimrc again.

1. https://github.com/BurntSushi/ripgrep

grep -H "# TODO" file1 dir1/* file2

Is also useful, as it prints the filename and the matching lines.

if you are using GNU grep, -H option gets enabled by default when there are multiple input files

Hopefully only when stdout isatty().

Edit: Nope, writes l̶i̶n̶e̶ ̶n̶u̶m̶b̶e̶r̶s̶ file names to output regardless. Boo.

you mean filename, not line numbers?

option -h will disable filename in output

This only works depending on how diligently you formatted those TODOs. Before you know it your regex explodes. I use IntelliJ as well, so I don't have to think about these problems.

I mean, how often do you place the four characters "TODO" in your code when you don't mean to mark a TODO? The only common English word I know of that contains that substring is "mastodon", and it'd have to be all-caps.

You could also include word boundaries if you cared enough.

    ag '\bTODO\b'

Does IntelliJ do something smarter than a regex to find TODO?

Visual Studio does the same ("Task List")

I really like JetBrain's Resharper for Visual Studio -- they have a very nice, flexible, and configurable 'TODO' window. For example, on our team we try to put TODO followed by our name or initials. The TODO window can then partition those out into separate lists.

Give Rider a go. I'm a complete convert; previous attempts were very unpleasant, but its a complete experience now, very similar feel to VS + RS, without the awful latency.

I cannot second this enough, Rider is so much nicer than VS these days. I too tried to convert to Rider previously and ended up not using it, but just a while ago I made the switch and spent some time watching some videos on what toys it has, and going through everything and configuring it how I like. It is a lot nicer and a lot quicker, and most importantly to me, has really good vim support (including easymotion / surround ).

I've seen it, but never taken the plunge. Thank you for the encouragement -- I'll definitely give it a go. That said, it's going to be extremely difficult to actually incorporate this in my 9-5 environment, so it will probably end up being for my home projects only.

out of interest, why do you think it'd be hard? It's what I did, just swapped over at work. Nearly everyone else is still using visual studio. It mostly is a zero friction change and you can swap back and forward between environments at any stage

Because I work in a highly regulated industry. We have to qualify/verify/validate everything that we use, and we all have to be standardized on the same thing. I'm currently struggling to get unit tests working smoothly -- we have to validate the "plugin" that we use to execute the unit tests (MSTest... part of Visual Studio), which means that we need to write requirements and then test those requirements. We're writing requirements for MSTest.... I'm pushing to get a CI pipeline set up so that our unit tests can be run automatically with every check-in, but we'll have to write-up requirements for whatever CI tool, validate that it works with our existing source control, validate that the unit tests execute properly, document it all, review it all, sign off on it all within our document control system. etc... Switching to an entirely new IDE I think would make people's heads explode. Personally I think that we make things excessively hard on ourselves -- I'm endeavoring to reduce some of that pain.

That sounds incredibly painful, I admire your tenacity.

Rails (or maybe it's just Rake) has `rake notes`

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact