This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 209253 - Highlight matching PHP tags
Summary: Highlight matching PHP tags
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-07 03:52 UTC by hal-b
Modified: 2016-09-22 02:12 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hal-b 2012-03-07 03:52:11 UTC
Product Version: NetBeans IDE Dev (Build 201202150400)
Java: 1.6.0_29; Java HotSpot(TM) 64-Bit Server VM 20.4-b02-402
System: Mac OS X version 10.7.3 running on x86_64; MacRoman; en_US (nb)

Please provide highlighting of matching PHP tags/markers/processing instructions when one tag is under the cursor, like with matching HTML tags or braces,

i.e.:

1) <?PHP ... ?>

as in:

<html>
    <head>
    </head>
    <body>
        <div>
            <?php  <--- HIGHLIGHT
                echo "Please indent me.";
            ?>     <--- HIGHLIGHT
        </div>
    </body>
</html>

Of particular importance is item 1.

Other formats are:

2) <script language="php> ... </script>
3) <?= ... >
4) <? ... ?>

Item 2 would be nice to match the appearance of javascript code in
<script type="text/php"> ... </script> tags, although I believe this is not universally supported.

I realize that the short tags in items 3 and 4 are deprecated as they depend on system settings on the server that may be turned off, and needn't be supported, but here are examples before and after formatting, and as desired per my bug 209150, just for any added clarity that may be needed:

Source:

<html>
<head>
</head>
<body>
<div>
<?php
echo "Please indent me 1.";
?>
</div>
<div>
<?php
{
echo "Please indent me 2.";
}
?>
</div>
<div>
<script language="php">
echo "Please indent me 3.";
</script>
</div>
<div>
<?
echo "Please indent me 4.";
?>
</div>
<div>
<?="Please indent me 5.";
?>
</div>
<div>
<?="Please indent me 6."; ?>
</div>
</body>
</html>

After format:

<html>
    <head>
    </head>
    <body>
        <div>
            <?php
            echo "Please indent me 1.";
            ?>
        </div>
        <div>
            <?php
            {
                echo "Please indent me 2.";
            }
            ?>
        </div>
        <div>
            <script language="php">
            echo "Please indent me 3.";
            </script>
        </div>
        <div>
            <?
            echo "Please indent me 4.";
            ?>
        </div>
        <div>
            <?= "Please indent me 5.";
            ?>
        </div>
        <div>
            <?= "Please indent me 6."; ?>
        </div>
    </body>
</html>

As desired:

<html>
    <head>
    </head>
    <body>
        <div>
            <?php
                echo "Please indent me 1.";
            ?>
        </div>
        <div>
            <?php
                {
                    echo "Please indent me 2.";
                }
            ?>
        </div>
        <div>
            <script language="php">
                echo "Please indent me 3.";
            </script>
        </div>
        <div>
            <?
            echo "Please indent me 4.";
            ?>
        </div>
        <div>
            <?=
                "Please indent me 5.";
            ?>
        </div>
        <div>
            <?= "Please indent me 6."; ?>
        </div>
    </body>
</html>

I also see a similar bug Bug 153639 from 2008.

Thank you for your help!
Comment 1 amobilia 2016-09-22 02:12:14 UTC
Reproductible in 8.2rc / Dev 201609210002 / win 10 x64