Repository navigation
Feature Request: Expose parameters to the Outline View #5153
Description
Activity
- addedIssue-BugA bug to squash.A bug to squash.Needs: TriageMaintainer attention needed!Maintainer attention needed!
on Mar 7, 2025 JustinGrote commented
on Mar 7, 2025 CollaboratorMore actionsThank you for your submission!
It is certainly possible to expose these via the Outline, we would probably make it an opt-in parameter. Marking this as
Up For Grabsand changing it to enhancement.This will probably first require semantic highlighting enabled and working, as the existing textmate grammer does not explicitly detect parameters, but rather just identifies them as variables.
As an alternative, ctrl+T (Go to symbol in workspace) lets you quickly find and navigate to any symbol in the environment, and parameters are present there.
Reacted by BinaryInk- addedUp for GrabsWill shepherd PRs.Will shepherd PRs.Feature: VS CodeRequest to use or implement a VS Code feature.Request to use or implement a VS Code feature.VerifiedThis issue has been determined to be a legitimate issue that requires a fix.This issue has been determined to be a legitimate issue that requires a fix.and removedIssue-BugA bug to squash.A bug to squash.Needs: TriageMaintainer attention needed!Maintainer attention needed!
on Mar 7, 2025 - changed the title
[-]Parameters do not appear in the Outline View[/-][+]Feature Request: Expose parameters to the Outline View[/+]on Mar 7, 2025 - addedIssue-EnhancementA feature request (enhancement).A feature request (enhancement).
on Mar 9, 2025 andyleejordan commented
on Mar 12, 2025 MemberMore actionsJustin Grote (@JustinGrote) The Outline view is lit up by the
DocumentSymbolHandler, and we are literally just skipping parameters (and I'm not sure why, the comment just says it should only include declarations):if (!symbolReference.IsDeclaration || symbolReference.Type is SymbolType.Parameter)
JustinGrote commented
on Mar 12, 2025 CollaboratorMore actionsAndy Jordan (@andyleejordan) right, I just figured we should be consistent if we light it up in the documentsymbolhandler, the symbol as presented to the user should be consistent.
We can probably make this an opt-in (or opt-out) option so as not to jar people's view who are used to not seeing parameters.

Prerequisites
Summary
Issue & Reproduction
First, searching through the open issues, this could be related to #3913, but I don't believe so as it doesn't matter whether the parameter declaration has attributes or not.
When creating a script using a
param()block, the parameters are not included in the outline. It doesn't matter whether the parameter(s) have attributes or defined types, it doesn't appearFor example, none of the following situations result in the appearance of parameters in outline:
In all of the above cases, both
$MyStringand$MyLooselyTypedParamare not surfaced in the Outline View in VSCode.However, I did notice that when using a function declaration, you can get the parameters to show up in the function's definition by using the in-line parameter declaration:
Where it will show up as
function My-NewFunc ([string]$MyString)even if the parameters are split into multiple lines. In any case, using an in-line function declaration isn't exactly a solution to the problem, as it is a long string in a small sidebar.Expected Behavior
I would expect the Outline View to behave similarly as it does in other .NET languages like C#.
For instance, using the above example, the outline would look more like:
Ideally, the parameters would be a child of a separate parent named something like
param()andbegin{}process{}end{}blocks would also be represented:representing:
But just having proper support for parameters in the outline would be extremely beneficial.
Conclusion
Unfortunately, without displaying parameters, the functionality of the Outline View is very limiting and only particularly useful for either a.) small scripts or b.) poorly made scripts that don't leverage the features of PowerShell that make it better than shell scripts (or actively work around intended usage, e.g., by applying parameters to variables according to argument position like a bash/shell script).
PowerShell Version
Visual Studio Code Version
Extension Version
Steps to Reproduce
See primary description outlining the issue; reproduction only requires the use of basic PowerShell features such as
functionandparam().Visuals
N/A
Logs
N/A