pilat / vscode-importmagic

MIT License
36 stars 7 forks source link

Add option to ignore folders #24

Open jendrikjoe opened 4 years ago

jendrikjoe commented 4 years ago

A warning first: Merging the current state of the PR would introduce a bug, which I wasn't able to fix myself.

This PR addresses #21

Given that multiple people (including myself) have vast amount of files and folders in their workspace and not all of them needed to be scanned by import magic this option allows to filter folders. It adds a configuration ignore_folders taking an array of folder names that should be ignored. This as well comes in handy to get rid of all suggestions for __pycache__ folders.

The way this is achieved is by taking the indexers blacklist_re and adding |\bfolder_name\b for each folder_name handed by the configuration. (This might lead to issues when this list is getting exhaustively long, but I think that is far of in the future πŸ˜‰)

As this is as well my first time contributing anything to a VSCode extension, I added some minimal hints to the README, so noobs like me have an easier time getting started πŸ˜‰

Due to my limited ability with developing extensions and not knowing how to write test for them there is one bug I could not resolve. I hope that someone else can pinpoint me in the direction where I need to search for it. When changing anything in the configuration, the extension breaks and doesn't work until I do Reload Window. Furthermore, the index is then only rebuild if I delete the index file.

I hope that this still provides a useful contribution even though it has its issues πŸ‘