atom / language-php

PHP package for Atom
Other
119 stars 119 forks source link

Array interpolation in PHP - brackets are colored like string #347

Open roblourens opened 5 years ago

roblourens commented 5 years ago

From https://github.com/Microsoft/vscode/issues/66231

<?php
$x = $y[123]
echo "123$foo[123]456";

The brackets are colored gray on top, but green (the string color) on bottom.

image

Edit by @rsese to add another screenshot

paren-scope

The problem seems to be that there is no specific color for "brackets" so when they are in a string, they fall back to the most specific available selector which is the color for strings.

rsese commented 5 years ago

Thanks for the report :+1:

@50Wliu I can reproduce in 1.34.0 but is this more a theme issue rather than an issue with the grammar? E.g. since I can tweak the styles with something like:

.syntax--php .syntax--string .syntax--array.syntax--begin,
.syntax--php .syntax--string .syntax--array.syntax--end {
  color: #abb2bf;
}

arrays-in-strings