vscode-todo-plus icon indicating copy to clipboard operation
vscode-todo-plus copied to clipboard

Support rendering some context around embedded tasks

Open nikitavoloboev opened this issue 5 years ago • 2 comments

Often TODO:'s are written above the code that is ideally in focus of the TODO.

Current embedded view only lists TODO:'s and the code on the same line with the TODO. Such as:

range: currentYear.map(date => daysSinceEpoch(date)), // TODO: fix

But below code:

// TODO: fix
`range: currentYear.map(date => daysSinceEpoch(date)), 

Will only return:

// TODO: fix

And miss out on that line.

I propose to add a setting so that embedded view not only shows TODO: but also the line below it as kind of useful metadata. It's very annoying having to go to @file:// of each TODO just to get more information regarding the task. This would partly solve this issue.

Ideally have this be a toggleable setting from command palette or perhaps hotkey so that the view can be easily changed from just TODO: display (current behavior) and TODO: with one line of code below TODO: displayed.

nikitavoloboev avatar Jun 05 '19 12:06 nikitavoloboev

Sounds reasonable, I didn't implement this because 99% of the time I put my comments on the same line, even if it gets really long.

The part about a command for toggling the setting I'm not so sure about, especially because I think there are already general standalone third-party extensions that can be used for that.

fabiospampinato avatar Jun 05 '19 12:06 fabiospampinato

The proposed solution will fail if there are just a bunch of todos listed one after the other (i.e. no actual line of code they refer to) 🤔

fabiospampinato avatar Aug 10 '19 21:08 fabiospampinato