jmrog / vscode-nuget-package-manager

An extension for Visual Studio Code that lets you easily add or remove .NET Core 1.1+ package references to/from your project's .csproj file using Code's Command Palette.
MIT License
34 stars 17 forks source link

Recursive search for project files should ignore some directories #17

Open jmrog opened 7 years ago

jmrog commented 7 years ago

Unnecessarily recursing through deep or heavily-populated directories when searching for project files can cause the extension to fail (when the process takes longer than 1 second). I noticed this myself when working on a hybrid .NET/JS app; the extension unnecessarily recursed through node_modules, causing the extension to silently fail. This specific issue was corrected by https://github.com/jmrog/vscode-nuget-package-manager/commit/3a5f7476a446a30e5de8ab190da96f35a52272ab. However, it would be good to have a more general solution. For C#/.NET projects, for example, it would be good not to traverse obj and bin directories. It would also be good not to traverse .vscode.

Probably the best general solution is to have a default configuration according to which the directories above (and others, pending investigation) are not searched, and to allow this configuration option to be overrideable, perhaps via a config file in the workspace root. It could also make sense to, by default, ignore the same directories ignored in the root .gitignore file, if one is present.