vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

Sticky Scroll showing a maximum of one line

Open arodir opened this issue 8 months ago • 4 comments

Prerequisites

  • [x] I have written a descriptive issue title.
  • [x] I have searched all open and closed issues to ensure it has not already been reported.
  • [x] I have read the troubleshooting guide.
  • [x] I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • [x] I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • [ ] If this is a security issue, I have read the security issue reporting guidance.

Summary

Sticky Scroll is limited to one line once the PowerShell extension's terminal is loaded. This is reproducable. Sticky Scroll is displaying multiple lines before the terminal has finished loading. This occurs in both 2025.3.0 and 2025.0.0 versions (and earlier, I don't remember it working before). This is on a fresh install of VS Code and the extension, no settings have been changed.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      5.1.26100.2161
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.26100.2161
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Name             : Visual Studio Code Host
Version          : 2025.3.0
InstanceId       : 6c283390-824b-4ec7-ad77-279d279a380b
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : de-DE
CurrentUICulture : de-DE
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Visual Studio Code Version

1.98.2
ddc367ed5c8936efe395cffeec279b04ffd7db78
x64

Extension Version

[email protected]

Steps to Reproduce

  • start a fresh install of VS Code
  • open a PowerShell file
  • see Sticky Scroll display multiple lines at the top
  • install PowerShell extension
  • see Sticky Scroll collapse to one line only after the terminal has finished loading

Visuals

Image

Logs

No response

arodir avatar Mar 24 '25 09:03 arodir

Thank you for reporting!

Do you have Semantic Highlighting enabled?

The PowerShell language in vscode is a little unique in that it has a default textmate grammar that is built into vscode, even without having the PS extension installed. Once it loads, if you have semantic highlighting loaded, it might change the symbol state here.

JustinGrote avatar Mar 24 '25 21:03 JustinGrote

Semantic Highlighting was enabled, but disabling it does not change anything in regards to Sticky Scroll.

Edit:

Workaround (or solution?): Changing the Sticky Scroll: Default Model from its default of outlineModel to foldingProviderModel makes Sticky Scroll work.

settings.json:

{
    "[powershell]": {
        "editor.stickyScroll.defaultModel": "foldingProviderModel"
    }
}

arodir avatar Mar 26 '25 12:03 arodir

Interesting, thanks for the further investigation! I'm not aware of the effect of the sticky scroll models so will need to determine if this is expected behavior or not.

JustinGrote avatar Mar 26 '25 16:03 JustinGrote

So after investigation, foldingProviderModel is what you want, because our LSP provides that folding information. The outline information model goes by symbols in the outline view on the right, so if the header you want is not provided by the outline provider, it won't show up there.

THe setting is interesting because the default says outline provider is preferred, and only uses folding if outline is not avaliable, but there is no "outline provider" specifically in the LSP spec, just the symbols provider, so need to investigate more about how these interact.

There is probably some tightening/alignment we can do to ensure the foldingProvider has the information from the outlineProvider so they are consistent, so that folding candidates are at least visible in the outline at a high level.

JustinGrote avatar Mar 26 '25 16:03 JustinGrote