Gruntfuggly / todo-tree

Use ripgrep to find TODO tags and display the results in a tree view
Other
1.4k stars 135 forks source link

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

Open Sorontik opened 1 year ago

Sorontik commented 1 year ago

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

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

maxaxehax commented 1 year ago

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.

MohammedNoureldin commented 5 months ago

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

TieWay59 commented 5 months ago

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.

baincd commented 4 months ago

This may be a duplicate of #749