-
Notifications
You must be signed in to change notification settings - Fork 120
A certain way of writing Ternary removes Syntax Highlighting of null #386
Comments
@darangi Why was this closed? Could you not reproduce it? A comment would have been nice. EDIT: Disregard and apologies. I got confused by the old issue and thought this one got closed. But you just added a label. |
This issue is not closed |
Are the labels on the screenshots backward? Is the complaint that the |
The complaint is that null should be colored but is not.
…On Wed 1. Apr 2020 at 20:19 Lee Dohm ***@***.***> wrote:
Are the labels on the screenshots backward? Is the complaint that the null
keyword *is* colored? Or *not* colored?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#386 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANMMCTMZH7BNZUSFXM3BM33RKNZRNANCNFSM4LUBFC2A>
.
|
@lee-dohm |
Using tree-sitter-php would solve this issue. tree-sitter-php produces a consistent syntax tree irregardless of formatting // example 1
$test = true ? null : 'hello world';
// example 2
$test = true ? null :
'hello world';
// example 3
$test = true ?
null :
'hello world'; All the examples will produce
There is a PR already to add tree-sitter-php grammar |
@sadick254 PR is out of date and not complete. Above that, It will not solve issue in vscode. It will be very hard to fix this issue since TM grammar is rather hopeless when comes to multi-line rules. I was trying to find solution to this, but failed. |
@finn-matti @sadick254 This took embarrassingly long time (a few hours at least, this time..), but I've fixed this and there will be PR shortly ;) This wasn't that complicated after all, basically I had to make goto label rule with higher priority in ternary and what important without colon itself. |
Prerequisites
Description
Null value looses coloration when colon is written on same line
Steps to Reproduce
See screenshots.
Actual behavior:
Expected behavior:
Reproduces how often:
Every time.
Versions
Additional Information
I raised the same issue earlier here but was referred to report it here. The maintainer said:
The text was updated successfully, but these errors were encountered: