1
votes

I'm using PHPStorm 6.0.3. Max for 6.x.

There's a random bug with syntax highlighting when PHP is inside HTML:

enter image description here

On some lines it works, on some it doesn't...

Text code for Copy/Paste:

        <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
        <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135"
             alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
    </a>
<?php if ($is_packs) { ?>
    <div class="pictos">
        <?php
          if ($_product->getAttributeText('heure_conso'))
            echo '<div class="heure-conso">'.$_product->getAttributeText('heure_conso').'</div>';
          if ($_product->getAttributeText('pack_spec'))
            echo '<div class="pack_spec">'.$_product->getAttributeText('pack_spec').'</div>';
          echo '<div class="nb-plats">'.$_product->getAttributeText('pack_spec').'</div>';
          if (Mage::helper('tbm/data')->productIsOkForCustomerPhase($_product))
            echo '<div class="phase-ok">'.$this->__('Adapté à votre phase').'</div>';
        ?>
    </div>
    <div class="description">
        <?php echo $_product->getShortDescription() ?>
    </div>
<?php } ?>

Any idea ?

1
Could you add the source along with the image so that someone could try it out to check if there's an issue with the code or your highlighter? - Rishi Dua
Add it to the bug tracker - Jerodev
Where is the bug exactly? -- I see none so far -- colloring is done accordingly to your (weird?) settings. - LazyOne
@LazyOne Can't you see the image ? - theredled
I see the image -- I just do not see a bug. Are you talking about that light green background? If yes -- it's your settings and not a bug (but yes -- from your point of view it could be treated as bug if you do not remember how you have configured that). - LazyOne

1 Answers

4
votes

Not a bug -- it's your custom settings.

For whatever reason / somehow (does not actually matter) you have injected custom language (most likely HTML) into all DIV tags (the light green background). Now everything in such tags is forcibly treated as that language (HTML?) -- PHP is ignored completely.

Settings (Preferences on Mac) | Language Injections -- find and delete offending rule. It should have "project" or "global" in most right column (Scope) -- do not touch "bundled" ones.

Alternatively -- Alt + Enter while having caret inside problematic place and choose "Uninject xxx" from popup menu.