Open Ingramz opened 9 years ago
See my post on Discuss about how the PHP grammar is designed:
https://discuss.atom.io/t/php-snippets-not-working/15321/8?u=leedohm
A PHP file is assumed to be an HTML template and has two major scopes, text.html.php
for the HTML portions and source.php
for the PHP portions. You may want to include both sets of patterns.
Tried one pattern at a time and also both, I can't seem to reach PHP-s parts with that grammar. If I add something else, for instance source.c
, then that works.
I was looking into language-blade grammar (https://github.com/jawee/language-blade/blob/master/grammars/blade.cson). To my surprise it features a PHP grammar of its own. Keeping this in sync with the language-php grammar could work, however I was thinking of a more novel solution so that there wouldn't be duplicate grammars.
The way how PHP grammar works with HTML grammar - through injection seems like a prefect way of solving this since blade syntax lives on the same level as
<?php ?>
tags inside the HTML document.So I thought, why not write our own injections for the PHP grammar, but including the PHP grammar does not seem to work as expected. But the issue I ran into is when referencing the PHP grammar.
With that grammar, only the HTML parts get highlighted. Is this intentional?