Support .gitignore
when scanning workspace for manifests
#71
Labels
enhancement
New feature or request
.gitignore
when scanning workspace for manifests
#71
Extracted from #68 (comment). Initially I thought it could be the part of mentioned PR but since it's more complex and the PR itself resolves initial issue, it will be better handled separately.
The reason for this task are further performance improvements. As described in the PR:
For context, scanning took less than 500ms while parsing more than 7 second.
Possible solutions
Adjust
workspace.findeFiles
to take into account.gitignore
sThere is no build in support for this and would need to be done manually. And this is a bit tricky because:
{line1,line2}
AFAIU) also making sure that**
are added if needed.monokle-saas
there are 17) which needs to be found first, parsed and glued to exclude glob.As an alternative, we could scan the same way as now and then just filter out ignored files (still requires parsing all gitgnores and glob filtering on resulted files list).
What is important here, I did a bit of benchmarking, and this method is pretty efficient (in relation to other approaches). For
monokle-saas
repo it took less than 500ms, and found 807 yamls.Use 3rd-party library
I tested this with
globby
. It has a build-in option to take gitignore files automatically into account. And it is considered one of the fastest JS implementations from what I see.However, there are 2 issues I see - the results are quite different - for build-in method I got
807
files while withglobby
only78
(even with gitignores not taken into account). Also scanning entire repo takesglobby
around 15 seconds on my machine (while VSC build in is less than 500ms).Others
It might be worth looking into how other extension do this maybe 🤔 I did quite searching in VSCode docs and outside for a build-in way or quick solution to do this in VSCode extension but haven't found anything worth mentioning here.
The text was updated successfully, but these errors were encountered: