Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpStorm how to detect/highlight closing "tag" in PHP's alternate syntax of contol structures

Tags:

php

phpstorm

Pretty much what the title says. Is there a way to make PhpStorm highlight the closing "tag" when using PHP's alternate syntax for control structures?

Take a look at this sample code for example:

<?
if($x==5) {
    echo "x is equal to 5";
}
?>

If i put the cursor next to or before the opening/closing brace, PhpStorm will automatically highlight the matching opening/closing brace.

Now, if we write the same code but this time using PHP's alternate syntax for control structures, we end up with something like this:

<? if ($x==5): ?>
x is equal to 5
<? endif; ?>

In this case, PhpStorm will not highlight either the opening "if" or the closing "endif;". Is there a way to make it highlight it?

like image 925
pazof Avatar asked Oct 17 '25 16:10

pazof


2 Answers

Unfortunately current versions of PhpStorm cannot do that.

https://youtrack.jetbrains.com/issue/WI-14517 -- watch this ticket (star/vote/comment) to be notified on any progress. So far it has not been associated with any specific future version (not currently planned for implementation).

Related: https://youtrack.jetbrains.com/issue/WI-566

like image 118
LazyOne Avatar answered Oct 20 '25 07:10

LazyOne


The 2017 version of PHPStorm now supports it. But apparently they are having issues with it that they turned off this feature, they did not mention what the issue is though. But you can still enable it by going to: Find Action->Registry->php.brace.alt.syntax

See response here Alternate PHP syntax

like image 41
Elymentree Avatar answered Oct 20 '25 07:10

Elymentree



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!