folke / todo-comments.nvim

✅ Highlight, list and search todo comments in your projects
Apache License 2.0
2.99k stars 87 forks source link

feature: TodoTelescope option to ignore directories #287

Open coxley opened 4 weeks ago

coxley commented 4 weeks ago

Did you check the docs?

Is your feature request related to a problem? Please describe.

Many of the projects I work in have generated code or git submodules. I'd like to check for a list of todos/fixmes/etc, but there's not currently a way to ignore certain paths.

Describe the solution you'd like

An additional parameter to TodoTelescope (and the other variants) would probably do it. Being able to provide multiple directories and/or globs would be solid.

Describe alternatives you've considered

Some projects have relevant code under a single dir, like proj/src with generated stuff at src/gen and src/protos. But that's a minority. Most share a parent directory, so providing explicit search paths would be unique per project.

Additional context

No response

b0ae989c commented 4 weeks ago

We don't need a new feature for this. Add those generated directories to .ignore and telescope will skip them. Should close.

coxley commented 3 weeks ago

@b0ae989c: I see... it does seem to acknowledge .gitignore but I'm seeing more results than I'd expect from submodules still. Those can't be ignored, for obvious reasons.

There's bound to be other scenarios where the amount of directories you want to include are less than those you want to exclude.

b0ae989c commented 3 weeks ago

.ignore and .gitignore are two different files.

Directories in .ignore are not skipped for Git, but they are skipped for Telescope's fuzzy searcher.

coxley commented 3 weeks ago

Got it. I guess some projects I can adjust the .gitignore to ignore .ignore for local preferences. Still seems like it'd be useful to have something controlled by the command itself. Would avoid submitting the 15 PRs I'm about to do in my company haha.