-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest version
- Search the existing issues.
Steps to reproduce
- Open VS Code
- Open new un-saved PowerShell file
- Paste the following into the window:
$EventLog = "EventLog"
Get-Service -Name EventLog
Get-Service -Name 'EventLog'
Get-Service -Name "EventLog"
Get-Service -Name ('EventLog')
Get-Service -Name $EventLog
Get-Service -Name $($EventLog)
Get-Service -Name @($EventLog)
Get-Service -Name ${EventLog}
Get-Service -Name:$($EventLog)
Get-Service -Name:EventLog
- Save File anywhere
Results:
Expected behavior
On save the syntax highlighting will remain the same as the first screenshot.Actual behavior
On saving the file the syntax highlighting does not display appropriately, see second screenshotError details
n/aEnvironment data
Name Value
---- -----
PSVersion 7.5.4
PSEdition Core
GitCommitId 7.5.4
OS Microsoft Windows 10.0.26200
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Version
latest? Visual Studio Code Host Version 2025.4.0
Visuals
See above screenshots for visuals. Also below:
Parameter & Parameter Value Separated by a space " " or colon ":" are seen as a single token when using the "Developer: Inspect Editor Tokens and Scopes" feature


Where the others are seen as separate because of another character: ' " ( $ @

Ideally, a function parameter (dash followed by letters and then separated by specific characters) should be it's own TextMate Scope / token that can be customized separate from the rest
Metadata
Metadata
Assignees
Labels
No labels
