HashTable Key TextMate Scope Priority

Open
#222 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
powershell
Domain
devtools

Research direction

Reproduce the example in VS Code with the shown PowerShell hashtable and inspect the TextMate scopes applied to keys and variables. Start by locating the syntax definitions for hashtable assignments and the variable scope precedence. Done means hash keys can receive a distinct color from variables without breaking the surrounding highlighting.

Written by the indexing model from the issue text.

Description

Summary of the new feature / enhancement
  1. Open VS Code
  2. Open a PowerShell File
  3. Copy the following into the file:
@{
    'string' = 'value'
    name     = funcName
    key      = $Variable
}

Result:
Image

Proposed technical implementation details (optional)

Currently the 'variable' TextMate scope is a higher precedence than the 'meta' scope so setting the meta.hashtable.assignment.powershell scope to a different color is overwritten by the variable scope.

Trying to get a the hash key to be a different color than variables

Dominant language
PowerShell
Stars
151
Forks
55
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PowerShell/EditorSyntax

All issues in PowerShell/EditorSyntax

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.