Find-Ast -AtCursor
doesn't work inside param(...)
blocks.
#2120
Labels
Find-Ast -AtCursor
doesn't work inside param(...)
blocks.
#2120
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
PowerShell 7.4.0
Editor Version
Visual Studio Code 1.85.1
PowerShell Editor Services Version
3.13.0
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
The text was updated successfully, but these errors were encountered: