PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.72k stars 495 forks source link

IntelliSense doesn't honor comment-based help for script files (`.ps1`), absent or broken syntax diagrams #4904

Open mklement0 opened 10 months ago

mklement0 commented 10 months ago

Prerequisites

Summary

IntelliSense with respect to script files (.ps1) that have comment-based help - as opposed to functions - currently has the following problems:

* Their synopsis is _not_ shown, because their [comment-based help](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_Comment_Based_Help) is seemingly not consulted.

* The formatting of their syntax diagrams is broken: they individual diagrams aren't separated with empty lines and instead form one long string without line breaks, resulting in arbitrary line wrapping. Situationally - as in the repro below - no syntax diagrams are shown at all.

PowerShell Version

Name             : Visual Studio Code Host
Version          : 2024.0.0
InstanceId       : 63cceb1e-397a-4b02-989f-55f2c40757c7
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Visual Studio Code Version

1.85.2
8b3775030ed1a69b13e4f4c628c612102e30a681
arm64

Extension Version

ms-vscode.powershell@2024.0.0

Steps to Reproduce

@'
<#
.SYNOPSIS
Foo's description.
#>
param(
  [Parameter(ParameterSetName='Foo')]
  $Foo,
  [Parameter(ParameterSetName='Bar')]
  $Bar
)
'@ > Foo.ps1

As the screenshot shows, neither the description nor the syntax diagrams are shown.

Visuals

image

Logs

No response

JustinGrote commented 10 months ago

Thanks, I'm hoping to take a look at hovers in general so I'll try to take a peek at this as well.