You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Peeking a variable definition doesn't appear to behave the same as peeking function definitions, when the variable is defined in a separate file. In the example, opening 'derp.ps1' and peeking the testFunction takes you to the definition in the /Resources/filePaths.ps1. However, peeking the $filePaths variable in derp.ps1, does not find the definition in the /Resources/filePaths.ps1 file, it just finds the first usage of the variable within the same file.
Is this expected behavior?
EDITS: To clarify issue description.
The text was updated successfully, but these errors were encountered:
The symbol look-up feature is relatively naive, in the sense that it doesn't understand scope qualifiers. filePaths is declared $global:filePaths but when you try to find $filePaths' references, the language server looks only for instances of $filePaths in the workspace and so it cannot find $global:filePaths.
But if we change $global:filePaths to $filePaths, the reference look up works fine. However, the definition look up does not succeed because there seems to a bug in the way a variable definition look-up is handled.
System Details
$PSVersionTable
:PSVersion 5.0.10240.16384
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.42000
BuildVersion 10.0.10240.16384
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
Issue Description
I setup an example here: https://github.com/bobfrankly/Derp
Peeking a variable definition doesn't appear to behave the same as peeking function definitions, when the variable is defined in a separate file. In the example, opening 'derp.ps1' and peeking the testFunction takes you to the definition in the /Resources/filePaths.ps1. However, peeking the $filePaths variable in derp.ps1, does not find the definition in the /Resources/filePaths.ps1 file, it just finds the first usage of the variable within the same file.
Is this expected behavior?
EDITS: To clarify issue description.
The text was updated successfully, but these errors were encountered: