[X] I am sure this issue is with PowerShell Editor Services itself and does not reproduce in a standalone PowerShell instance, and is not an issue with my editor.
[X] I have verified that I am using the latest version of PowerShell Editor Services.
In Visual Studio Code with the PowerShell extension installed, placing the cursor inside a param(...) block in or next to a parameter (variable) declaration and calling Find-Ast -AtCursor doesn't recognize the cursor location as a System.Management.Automation.Language.ParameterAst instance and instead returns the entire script (System.Management.Automation.Language.NamedBlockAst)
It currently only works in inline parameter declarations of functions.
PowerShell Version
PowerShell 7.4.0
Editor Version
Visual Studio Code 1.85.1
PowerShell Editor Services Version
3.13.0
Steps to Reproduce
Using the PIC (PowerShell Integrated Console) in Visual Studio code with psedit $PROFILE, add the following code to $PROFILE (and ensure that profile loading is enabled):
Prerequisites
Summary
In Visual Studio Code with the PowerShell extension installed, placing the cursor inside a
param(...)
block in or next to a parameter (variable) declaration and callingFind-Ast -AtCursor
doesn't recognize the cursor location as aSystem.Management.Automation.Language.ParameterAst
instance and instead returns the entire script (System.Management.Automation.Language.NamedBlockAst
)It currently only works in inline parameter declarations of functions.
PowerShell Version
Editor Version
PowerShell Editor Services Version
Steps to Reproduce
psedit $PROFILE
, add the following code to$PROFILE
(and ensure that profile loading is enabled):keybindings.json
:$Foo
and press F2You should see
System.Management.Automation.Language.ParameterAst
, but currently getSystem.Management.Automation.Language.NamedBlockAst
Visuals
Logs
No response