vscode-powershell
vscode-powershell copied to clipboard
Ability to ignore certain folders from CodeLens or References
Prerequisites
- [X] I have written a descriptive issue title.
- [X] I have searched all issues to ensure it has not already been reported.
Summary
I would like to be able to ignore certain folders from being used by CodeLens, References, and so on.
During the building of my module, I often have additional folders called Releases or Artifacts where I push built modules. Sometimes it's just one version, sometimes 50 last version and this affects some things:
- It slows down PowerShell Features
- It's picked up by references
- Jumping to function often jumps to built code rather than to the "expected" function.
When excluded those PS1 files would be skipped and would improve general performance.
Proposed Design
Some option in JSON to exclude $PSScriptRoot\Artifacts or $PSScriptRoot\Releases
Related, similar feature request: https://github.com/PowerShell/vscode-powershell/issues/3048
Also related to https://github.com/PowerShell/vscode-powershell/issues/3902.
This will be incorporated into references refactor work
Support for this was already added some time ago (though tbh I only noticed while redoing some of the references code), it uses the existing setting search.exclude
. For example, in my profile directory I have this settings.json
:
{
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/*.code-search": true,
"/Modules": true,
}
}
Which excludes all of my installed modules from workspace analysis.
That said, I did also make it a lot faster, and the cost is all upfront instead of every code lens refresh. So may not be needed, but if it is, it's available!
Thank you for your comment, but please note that this issue has been closed for over a week. For better visibility, consider opening a new issue with a link to this instead.