Sublime Forum

Build 3114 HTML doesn't work correctly inside PHP Control Structures

#1

Hey guys,

Since the latest 3114 build, HTML inside PHP control structures doesn’t work correctly. Syntax highlighting, emmet, default HTML tag expansions. Nothing works at all. Here’s a quick screencast:

Anyone aware of this issue?

Thanks!

4 Likes

#2

I thought I was just me, i have same problem when i update to 3114 some hours ago :frowning: only works if i change syntax to html on bottom

0 Likes

#3

@rhcarlosweb, yep, there’s no point however changing the syntax to HTML if we are working with PHP :stuck_out_tongue:

One thing, when I change the control structure to alternate (endif) syntax, it works fine:

0 Likes

#4

If you really want to work around this yourself before the next build is released, you need to make a manual override and basically revert this commit.

To do this:

  1. install PackageResourceViewer from Package Control if it is not already installed
  2. open the Command Palette
  3. type: PRV: O and select PackageResourceViewer: Open Resource
  4. select PHP
  5. select PHP Source.sublime-syntax
  6. Comment out lines 70-78 by putting a # at the start of the line.
  7. Save the file
  8. IMPORTANT: Don’t forget to delete this file (Tools menu -> Browse Packages -> PHP) when you upgrade to the next build because it may be fixed properly.

Note: this isn’t a perfect solution, you will still end up with this syntax highlighting bug: https://github.com/sublimehq/Packages/issues/362

0 Likes

#5

@kingkeith has this been reported on the issue tracker?

0 Likes

#6

@qgates, yes, there is a reference to this forum post in this issue: https://github.com/sublimehq/Packages/issues/387

0 Likes

#7

@kingkeith ah great, on phone atm :slightly_smiling: so I presume this has already been fixed?

0 Likes

#8

This same on:
php -> tab
doesn’t expand to <?php ?>

0 Likes

#9

@kingkeith thanks for the quick fix, I’ll try that out. However, really hoping for an official fix soon as this is important.

0 Likes

#10

Try or use in the meantime PHP Grammar. It should work fine.

0 Likes

#11

Thanks for the solution, @gerry! It indeed helped. Not completely resolved the issue, PHP expansion doesn’t work, but HTML expansion does. So half of the issue resolved.

Thank you!

0 Likes

#12

@zeshanshani php expansion? Can you give an example?

HTML seems to fine:

#page>div.logo+ul#navigation>li*5>a{Item $}<tab> expands to

<div id="page">
    <div class="logo"></div>
    <ul id="navigation">
        <li><a href="">Item 1</a></li>
        <li><a href="">Item 2</a></li>
        <li><a href="">Item 3</a></li>
        <li><a href="">Item 4</a></li>
        <li><a href="">Item 5</a></li>
    </ul>
</div>
1 Like

#13

Having installed php-grammar make sure you also install the completions and snippets which are not included in the grammar. I should maybe think about auto installing those when the grammar is installed because the grammar disables the default native php package.

PHP Completions, PHP Snippets, and PHPUnit.

0 Likes

#14

I’m having the same problem. For example, typing ‘div’ + TAB in some html, used to bring up the completion with a full

etc. Since the update, it is trying to complete with a PHP function (variant_div). This is really hampering my coding. Is there anyway to roll back to the update in its entirety?
0 Likes