facelessuser / BracketHighlighter

Bracket and tag highlighter for Sublime Text
https://facelessuser.github.io/BracketHighlighter/
1.74k stars 245 forks source link

PHP angle brackets bug #608

Closed johntor closed 1 year ago

johntor commented 1 year ago

When angle brackets are enabled in php and there is a n array assignment symbol '=>' the BracketHighlighter is unable to match brackets...

facelessuser commented 1 year ago

Can you post a reproducible example?

johntor commented 1 year ago

You can try the following...


<?php
class Example {
    public function __construct() {
        $result = DB::getResult();
        foreach ($result as $row => $data) {
            echo($data)
        }
    }
}

Which gives: example

A quick and dirty solution I found is to disable 'angle' brackets for php from settings file, adding another "scope_exclude" for 'embedding.php'

solution

Keep on the great work!!!

J!

facelessuser commented 1 year ago

Yeah, the syntax keeps changing, that is why there are so many PHP exclusion rules. I don't use PHP very often, so I'm often not aware of the changes until a heavy PHP user brings it to my attention.

Thanks for the detailed info and the solution. I'll update the rule for the next release.

johntor commented 1 year ago

We thank you for your effort to make us more productive!!

J!

facelessuser commented 1 year ago

Okay, we are actually going to go with embedding.php punctuation.separator.key-value.php as embedding.php will break tag matching in PHP.