I'm trying to exclude a test folder in the workspace root:
"todo-tree.excludeGlobs": [
"test/**"
]
But I have other nested test folders elsewhere in the workspace which I don't want excluded, so **/test/** is not a suitable alternative.
Also, because matches are happening on the full path, that means that any folder outside the project can affect the glob matches! So if I happen to have my workspace in /home/john/test/foo everything gets excluded.
Would it work if you put the full path to the test folder you want to exclude?
I'm not sure what the solution is - I could add support for placeholder substitution (eg ${workspaceRoot}) in the glob configuration?
Can VSCode's built-in glob support be used?
If not, a minimal fix would be to strip the current value of workspaceFolder from the beginning of the path being matched, rather than substituting it in as there's no reason to want to match on folders outside the workspace.
I think I see what the problem is - but unfortunately, it uses full paths to make the tree handling simpler.
I could add an option to make the globs relative - I'll try some things out...
I assume that you have too many folders to make todo-tree.includeGlobs useful?
Code's built-in glob support be used?
Unfortunately not - there's nothing in the API (as far as I know).
We could change things so that todo-tree auto puts the root folder onto the front of all globs?
I also noted that in my giant project, it would be really nice if the excluded globs were added to the ripgrep execution; I see currently the code looks at a non-existant globs setting from the configuration for controlling such things, so ripgrep parses EVERYTHING, and then todo-tree applies the included and excluded globs.
I might have a look at addressing these issues.
Looking at the user guide of ripgrep, under the Automatic filtering section, it is explained that you can use .gitignore, .ignore and .rgignore files to define which files/folders to exclude (and, for me, it works). Isn't it something worth mentioning as an alternative to "todo-tree.excludeGlobs"? (which, for me, did not work at all, ripgrep would always try to search two very large directories I wanted to exclude)
@Thalos12 - @somewhatabstract contributed a change which passes the exclude globs to ripgrep, so hopefully that will help.
Thanks! I will try again as soon as I can.
@jahewson - do you still have the issue or have you found a workaround? If not, I'll add an option to remove the workspace root from the filenames for glob matching.
@Gruntfuggly - I tried again in the very large directory (where two subdirectories are >50GB) excluding all csv or cat files (as they contain only numbers) with the following
"todo-tree.excludeGlobs": [
"**/*.csv",
"**/*.cat"
]
It completes in about 3 minutes 10 seconds, which is great when compared to the time it took before the change by @somewhatabstract.
However, those subfolders are still explored by rg, and this is the reason why it takes 3:10 minutes (on 100GB+ of files, which is a lot and probably not common).
I found excluding whole folders via the .rgignore file to be a better solution for me, because in this case the time taken by rg is so short that I don't even notice it.
Finally, thanks a lot for your hard work!
You could use those exclude globs to exclude directories too
On Thu, May 16, 2019, 10:21 Alessandro notifications@github.com wrote:
@Gruntfuggly https://github.com/Gruntfuggly - I tried again in the very
large directory (where two subdirectories are >50GB) excluding all csv or
cat files (as they contain only numbers) with the following"todo-tree.excludeGlobs": [ "**/*.csv", "**/*.cat" ]It completes in about 3 minutes 10 seconds, which is great when compared
to the time it took before the change by @somewhatabstract
https://github.com/somewhatabstract.However, those subfolders are still explored by rg, and this is the
reason why it takes 3:10 minutes (on 100GB+ of files, which is a lot and
probably not common).
I found excluding whole folders via the .rgignore file to be a better
solution for me, because in this case the time taken by rg is so short
that I don't even notice it.Finally, thanks a lot for your hard work!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Gruntfuggly/todo-tree/issues/130?email_source=notifications&email_token=AAJVE6KXEFRO7776KXXMSBTPVV3Y7A5CNFSM4GZAU4RKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVSE6YQ#issuecomment-493113186,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJVE6LQJOR2RXT7QLUAWKTPVV3Y7ANCNFSM4GZAU4RA
.
Well, stupid me, I did not think of doing that, so I will try it, thanks!
Let us know if that worked. :grin:
It works perfectly! @Gruntfuggly and @somewhatabstract, thanks a lot for your help and for putting up with me on my problem!
Glad you got it working. :grin:
Most helpful comment
It works perfectly! @Gruntfuggly and @somewhatabstract, thanks a lot for your help and for putting up with me on my problem!