$test:/ - colon is not being parsed correctly on string

Open
#192 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
powershell
Domain
tooling

Research direction

Reproduce the examples in VS Code using the PowerShell syntax-highlighting support, comparing cases where the colon is followed by /, -, or @ with the plain colon case. Inspect the syntax grammar or entry point responsible for variable highlighting; done means the colon remains associated with $ip in all shown examples.

Written by the indexing model from the issue text.

Description

Environment
  • Editor and Version (VS Code, Atom, Sublime): vscode 1.42.0-insiders
  • Your primary theme: Monokai
Issue Description

From my tests, this seems to only happen if the colon is followed by some sort of special character such as - @ / etc

Screenshots

image

Expected Behavior

It should parse correctly, like this (taken from windows powershell). Notice that the colon is green, since it "belongs" to the variable:
image

Code Samples
$ip = "192.1.1.1"
###not being parsed###
"pi@$ip:/home/pi/PowerShell_IoT/"
"pi@$ip:-home/pi/PowerShell_IoT/"
"pi@$ip:@home/pi/PowerShell_IoT/"
###parsed correctly when without special characters###
"pi@$ip:home/pi/PowerShell_IoT/"
###correct syntax###
"pi@$ip`:/home/pi/PowerShell_IoT/"```
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.