Description
System Details
- Operating system name and version: Windows 10
- VS Code version: 1.25.1
- PowerShell extension version: 1.8.1
- Output from
$PSVersionTable
: see below
S C:\Users\me> code -v
1.25.1
1dfc5e557209371715f655691b1235b6b26a06be
x64
PS C:\Users\me> $psEditor.EditorServicesVersion
Major Minor Build Revision
----- ----- ----- --------
1 8 1 0
PS C:\Users\me> code --list-extensions --show-versions
[email protected]
[email protected]
[email protected]
PS C:\Users\me> $psversiontable
Name Value
---- -----
PSVersion 5.1.14393.2248
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.2248
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Issue Description
I am not sure whether this is a VSCode issue or a PowerShell Extension issue so please forgive me if I have logged this in the wrong place.
In the latest version of VSCode (1.25.1) with the latest version of the PowerShell Extension (1.8.1) on Windows 10:
If you cast your variables by prefixing them with the type, e.g. [string], the “Go to Definition” and “Peak Definition” functions do not work.
Example:
[string]$testVar = "Test123"
$testVar
Right-click on the second ‘$testVar’ and select either “Go to Definition” or “Peak definition” and you’ll get an error “No definition found for $testVar”. Screenshot:
Try it without casting it as a [string] and it works as expected.