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

[BUG] Tree entries are removed until manually refreshed on file close, if "scan mode" is "workspace only" and "autoRefresh" is true #714

Closed yw662 closed 1 year ago

yw662 commented 1 year ago

When scan mode is "workspace only" and "autoRefresh" is true, and user close a file, the entries inside file will be removed from the tree, and will never be back until user do a manual refresh. This behavior is semantically a bug anyway since it says "workspace only" instead of "workspace only but recently closed files excluded". This can be confusing when walking through the tree, because vscode will automatically close the file opened by clicking tree entries. User click a tree entry to look at it, and another entry from another file is clicked, and the entries in the original file are removed. AutoRefresh should be off as a workaround for users stick to "workspace only" mode. I see no harm of it though. However, for users using multiple modes, this can be painful.

I would suggest two versions for this, by adding config.scanMode() !== SCAN_MODE_WORKSPACE_ONLY to either line 1584 or 1588 of src/extension.js: https://github.com/Gruntfuggly/todo-tree/blob/4eb316842aba1c8d61aa087516d8d2a17ee5ab56/src/extension.js#L1584 https://github.com/Gruntfuggly/todo-tree/blob/4eb316842aba1c8d61aa087516d8d2a17ee5ab56/src/extension.js#L1588

terms: tree entries removed, workspace only, autoRefresh