Function Parameter Not its own TextMate Scope
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- powershell
- Domain
- tooling
Research direction
No repository files or tests are named. Reproduce the examples in VS Code, inspect the TextMate scopes before and after saving, and trace the PowerShell grammar entry point responsible for parameter tokens. Done means function parameters are scoped separately from their values and the highlighting remains consistent after saving.
Written by the indexing model from the issue text.
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
Result:
- 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 screenshot
Error details
n/a
Environment 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.0
Version
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
- Dominant language
- PowerShell
- Stars
- 151
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PowerShell/EditorSyntax
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
PowerShell/EditorSyntax#224 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
PowerShell/EditorSyntax#222 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
PowerShell/EditorSyntax#220 · 2 comments · 1 reaction ·
-
Issue-Bug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
PowerShell/EditorSyntax#219 · 2 comments ·
-
Issue-Bug Needs: Triage :mag:
Difficulty 3/5 1-2 days Newbie friendliness 35/100
PowerShell/EditorSyntax#217 ·
All issues in PowerShell/EditorSyntax
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
idean3885/claude-ops-agent#521 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
0xMiden/bridge-portal#132 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
newrelic-experimental/preflight#793 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
babalae/bettergi-scripts-list#3674 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
caddyserver/caddy#8046 ·