Summary
When hovering over a function call (or its definition) in a .ps1 script, the hover tooltip shows the function signature but does not display the comment-based help content (.SYNOPSIS, .DESCRIPTION, .PARAMETER).
Steps to Reproduce
- Create a
.ps1 file with a function that has comment-based help:
<#
.SYNOPSIS
Writes a colored line to the console.
.PARAMETER Message
The text to display.
.PARAMETER Color
The foreground color to use.
#>
function WriteColorLine([string] $Message, [ConsoleColor] $Color)
{
$prev = [Console]::ForegroundColor
[Console]::ForegroundColor = $Color
[Console]::WriteLine($Message)
[Console]::ForegroundColor = $prev
}
WriteColorLine "Hello" Cyan
- Hover over
WriteColorLine on the call site or the definition.
Expected Behavior
The hover tooltip should display the Synopsis, Description, and Parameter documentation from the comment-based help block (similar to how C# displays XML doc comments).
Actual Behavior
The hover tooltip only shows the function signature. No Synopsis or Description text is displayed.
Tested Placements
All valid comment-based help placements were tested with the same result:
- Above the function keyword
- Inside the function body (first statement, before
param())
- Inside the function body with
param() block after the help comment
In all cases, Get-Help correctly displays the documentation when the script is dot-sourced, confirming the help syntax is valid.
Environment
- VS Code PowerShell Extension: v2024.x+
- OS: Windows 11
- PowerShell: 7.x
Summary
When hovering over a function call (or its definition) in a
.ps1script, the hover tooltip shows the function signature but does not display the comment-based help content (.SYNOPSIS,.DESCRIPTION,.PARAMETER).Steps to Reproduce
.ps1file with a function that has comment-based help:WriteColorLineon the call site or the definition.Expected Behavior
The hover tooltip should display the Synopsis, Description, and Parameter documentation from the comment-based help block (similar to how C# displays XML doc comments).
Actual Behavior
The hover tooltip only shows the function signature. No Synopsis or Description text is displayed.
Tested Placements
All valid comment-based help placements were tested with the same result:
param())param()block after the help commentIn all cases,
Get-Helpcorrectly displays the documentation when the script is dot-sourced, confirming the help syntax is valid.Environment