Join GitHub today
Use injections for SQL strings #330
Description of the Change
Now that language-sql has begin/end matches, injections are needed so that the PHP patterns are matched inside the begin/end ones as well. Unfortunately, due to some annoyances with how injections work, I had to place the injections inside of the wrapper
I would love to hear proposals for alternate designs.
Embedded SQL strings should no longer have the chance of ruining syntax highlighting for the rest of the file.
Grammar becomes harder to parse due to the injections being in a separate file.
@50Wliu I took a quick look at it and it seems like the culprit is that you are trying to include from a repository of a different grammar inside the injection:
When I copied these repository items to the html grammar's repository and included those instead, it seemed to work without issues. Indirectly including
Whether it is supposed to work in TextMate remains to be seen once I get home from work.
Overall, the idea of using injections seems suitable for at least PHP. Having to do it from the html grammar is somewhat suboptimal, but since nested injections definitely do not work in TextMate, this is probably the best chance we got if it works.