vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

Ability to ignore certain folders from CodeLens or References

Open PrzemyslawKlys opened this issue 2 years ago • 3 comments

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:

  1. It slows down PowerShell Features
  2. It's picked up by references
  3. 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

PrzemyslawKlys avatar Mar 21 '22 10:03 PrzemyslawKlys

Related, similar feature request: https://github.com/PowerShell/vscode-powershell/issues/3048

andyleejordan avatar Mar 22 '22 19:03 andyleejordan

Also related to https://github.com/PowerShell/vscode-powershell/issues/3902.

andyleejordan avatar Aug 03 '22 18:08 andyleejordan

This will be incorporated into references refactor work

SydneyhSmith avatar Aug 31 '22 17:08 SydneyhSmith

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!

SeeminglyScience avatar Dec 19 '22 20:12 SeeminglyScience

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.

ghost avatar Dec 19 '22 20:12 ghost