Skip to content

Feature Request: Expose parameters to the Outline View #5153 - #2340

Open
darlingtonogbuefi wants to merge 1 commit into
PowerShell:mainfrom
darlingtonogbuefi:feature/expose-parameters-outline
Open

Feature Request: Expose parameters to the Outline View #5153#2340
darlingtonogbuefi wants to merge 1 commit into
PowerShell:mainfrom
darlingtonogbuefi:feature/expose-parameters-outline

Conversation

@darlingtonogbuefi

Copy link
Copy Markdown

PR Summary

Implements the PowerShell Editor Services portion of #5153 by adding optional support for displaying function parameters in the Outline view.

Changes

  • Add EnableParameterOutline to LanguageServerSettings.
  • Update PsesDocumentSymbolHandler to include parameter symbols when enabled.
  • Keep parameters excluded by default.
  • Add regression tests for both enabled and disabled behavior.
  • Add a test fixture containing a function with typed and untyped parameters.

Testing

Targeted tests:

dotnet test test/PowerShellEditorServices.Test/PowerShellEditorServices.Test.csproj --filter "FullyQualifiedName~DocumentSymbolHandlerTests"

Result:

  • net8.0: passed
  • net462: passed
  • 4 tests passed, 0 failed.

The full test suite was also run and reported two unrelated failures:

  • DebuggerAcceptsInlineScript
  • FindsDetailsForBuiltInCommand

PR Context

Related issue

PowerShell/vscode-powershell#5153

Copilot AI balanced review requested due to automatic review settings September 6, 2026 21:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The behavior change is correctly feature-gated (default off) and is covered by targeted regression tests for both modes.

Pull request overview

Adds an opt-in Language Server setting to include PowerShell function parameters as symbols in the LSP DocumentSymbol “Outline” view, keeping the existing default behavior unchanged.

Changes:

  • Introduces EnableParameterOutline on LanguageServerSettings and wires it into settings updates.
  • Updates PsesDocumentSymbolHandler to include SymbolType.Parameter declarations only when the setting is enabled.
  • Adds regression coverage (enabled/disabled) plus a shared .ps1 fixture containing typed and untyped parameters.
File summaries
File Description
test/PowerShellEditorServices.Test/Language/DocumentSymbolHandlerTests.cs Adds tests asserting parameter symbols are excluded by default and included when enabled.
test/PowerShellEditorServices.Test.Shared/Symbols/DocumentSymbolParameters.ps1 Adds a minimal fixture script with a function containing parameters to drive symbol generation.
src/PowerShellEditorServices/Services/Workspace/LanguageServerSettings.cs Adds EnableParameterOutline and includes it in LanguageServerSettings.Update().
src/PowerShellEditorServices/Services/TextDocument/Handlers/DocumentSymbolHandler.cs Injects ConfigurationService and gates inclusion of parameter symbols on EnableParameterOutline.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants