Why is there no support for HTML/JS Code coloring, autocomplete in "echo <<<_END <multiline html, js code> _END"?

Hello PhpStorm community

I have started to learn PHP recently from Learning PHP, MySQL, and JavaScript book.  In this book the following syntax (<<<END) is used frequently:

echo <<<_END
<form action="sqltest.php" method="post"><pre>
  Author <input type="text" name="author" />
   Title <input type="text" name="title" />
Category <input type="text" name="category" />
    Year <input type="text" name="year" />
    ISBN <input type="text" name="isbn" />
         <input type="submit" value="ADD RECORD" />
</pre></form>
_END;  

Unfortunatelly in PhpStorm the content between _END is seen by PHPStorm as plain String, so there is no smart support and syntax coloring for this.

As soon as a replace it with

echo '
<form action="sqltest.php" method="post"><pre>
  Author <input type="text" name="author" />
   Title <input type="text" name="title" />
Category <input type="text" name="category" />
    Year <input type="text" name="year" />
    ISBN <input type="text" name="isbn" />
         <input type="submit" value="ADD RECORD" />
</pre></form>
';
I get the full power of the IDE for the content (code completion, syntax coloring, except for error highlighting).



Is there a way to get the full power of the IDE for the <<<_END php syntax? Could this be a feature support?

Thank you in advance
3 comments

Hi Antonel,

Try HTML instead of _END

0

Thank you Andriy Bazanov

I've googled it and I've found out this is a  PHP here document syntax. PHP allow to write whatever you want instead of END.
Is there  an IDE preference to use another token instead of HTML, and have syntax highlighting and auto-completion?

Regards

0

Settings | Language Injections

There are rules for HTML, CSS, JS, RegEx, SQL, XML already.

You can look at how they's are done and create similar yourself.

0

Please sign in to leave a comment.