PowerShellEditorServices icon indicating copy to clipboard operation
PowerShellEditorServices copied to clipboard

Function definition of the same name is counted as a reference

Open nohwnd opened this issue 5 years ago • 2 comments

Functions that have the same name are counted as references. This is problematic because I have files where I combine ps1 files into a built module, and this path is indexed by VS. This makes all my functions to show one or more references even though there are no calls to that function.

image

nohwnd avatar Apr 24 '20 14:04 nohwnd

This also affects nested functions, ex. helper functions that share name (recursiveLookup() etc.)

function someFunc {
    function myHelper {}
    myHelper
}

function myHelper {}

fflaten avatar Aug 14 '22 17:08 fflaten

Original issue fixed in vscode-powershell 2022.9.0. Ready to close My example is harder to fix as scoping it problematic.

fflaten avatar Feb 07 '23 18:02 fflaten