Closed muteboy closed 2 years ago
Hi @muteboy. Apologies for taking so long to respond. I've thought about this a bit but I do see some challenges with implementing it. It would be hard to auto-add an id:x
tag at creation time because new tasks are not created through the extension. The user just types a new line and the extension simply decorates it accordingly. There could be an additional command that would scan the file for the highest id
and then add incrementally to the current task, the selected tasks, or the entire file, I suppose.
Sorting would be difficult since this is just text. While I do offer sorting by certain task attributes, none of them depend on the value of an attribute on another task so that would take some work.
Additionally, there is a potential data integrity issue - it would be easy to create a file that has invalid references. For example, task 1 depends on 2 and task 2 depends on 1, or task 1 depends on 3 but 3 doesn’t exist, or two tasks with the same id are created.
This feature would add a fair amount of complexity to the extension for a non-standard feature so it's not going to be very high on my list, but I will think about it some more.
Hi, Yes, I agree with all that. It would add a lot of hacky complexity! Thanks for thinking about it.
In another todo.txt tool (topydo) I've seen the ability to set a dependency between one task and another. This was really great and very useful. It was done by adding an
id:[num]
tag in the task that must come first, and ap:[num]
tag in the second task, referring to the prerequisite.I know this is not built-in to todo.txt, but I think I saw it somewhere as a possible future feature.
I much prefer working in VSCode. It would be GREAT if this could be added. I only dabble in coding, and I don't know TS at all, or I'd try something myself.
Here's how it might work:
id:
tags only when the dependency is defined. Maybe all tasks could be assigned a uniqueid:
on creation? Just the next available integer in the file? Once a task is archived to done.txt, its number is freed up.p:
tag to a task, referring to theid:
of the task it depends on. Other ways to identify a prerequisite?p:
tags would come first. I think that would be a bubble sort - it would have to check each pair and make sure that the prerequisite appeared before the task that needs it.Example:
Add ids:
Set precedence:
Sort by Prerequisite:
Any chance this could be implemented? Happy to discuss further.