todo-tree icon indicating copy to clipboard operation
todo-tree copied to clipboard

Tree-View sometimes only displays TODOs from current file in scan-mode "workspace and open files"

Open Sorontik opened this issue 2 years ago • 4 comments

I have the Problem that the Tree View most of the time only displays issues from the current file.

The Todo-Tree ouput says it has found 11 items (which is a realistic number) and 11 items remain after applying globs, but only the one of them from the file in the currently active editor tab is displayed in the tree view. If i change to a different editor tab, only the TODOs from this file are visible in the Tree view.

Sometimes the TreeView does list all the TODOs from my current project, but i can't tell when - it feels rather random. (I did not change the scan-mode)

I'm in scan-mode "workspace and open files" which i interpret as

  • all the items from all files in the current workspace
  • all items from files that are outside the current workspace but opened in the editor

When i change the scan-mode to workspace only, all items from my current project are displayed. (In this mode i would expect issues from files, that are opened in the editor but reside outside the workspace to be ignored)

In scan-mode "current file only", it works as expected, except if you open a file that contains no todos, the tree-view continues to display the list from the last file that did contain issues (even if you edited multiple files without todos in between)

So it looks to me as if the scan-modes do not entirely work as their names suggest.

SIDE-NOTE: it would really be nice to have a wiki-page with explanations of the various settings. what exactly do the scan-modes mean, what are the implications of activating/deactivating options like "Tree: Track File" and so on

Sorontik avatar Feb 23 '23 12:02 Sorontik

I'm having a similar issue, but I think I've figured it out.

The scan mode "workspace and open files" behaves exactly as the name says. It's just not what you would intuitively expect.

It only scans file that are open currently AND are part of the workspace/folder which is open. BOTH have to be true for the file to be scanned - not OR. So if you have an open file that is not in the worskpace, it's TODOs won't be shown. And TODOs in the workspace which are in files not currently open won't show up either, methinks.

This is less a bug and more a weird feature - I agree with you that having a scanmode where EITHER of the two kinds of files are scanned would be more useful.

maxaxehax avatar Mar 05 '23 10:03 maxaxehax

I have seen this behavior too, which confusing.

@maxaxehax This could be correct. But it is actually not the same behavior when applying Group by Tag. When this is enabled, you see actually all tags. Check this https://github.com/Gruntfuggly/todo-tree/issues/749

MohammedNoureldin avatar Jan 24 '24 20:01 MohammedNoureldin

I've met the same issue, I can provide some screenshots:

image

image

@Gruntfuggly I believe this is a confusing behavior. If you don't have time to fix it, could you give us some hints on where to start? I appreciate your work and I've been using it for a long time.

TieWay59 avatar Jan 31 '24 02:01 TieWay59

This may be a duplicate of #749

baincd avatar Mar 09 '24 15:03 baincd