VS Code syntax highlighting for Qiq PHP template files (.qiq.php).
- Full syntax highlighting for Qiq
{{ }}template tags with embedded PHP - Standard
<?php ?>and<?= ?>tag highlighting - HTML highlighting outside of tags
- Bracket matching and auto-closing for
{{ }} - Code folding for Qiq control structures (
if/endif,foreach/endforeach, etc.)
| Tag | Description |
|---|---|
{{ code }} |
Non-echoing PHP (if, foreach, etc.) |
{{= $var }} |
Raw (unescaped) echo |
{{h $var }} |
HTML-escaped echo |
{{a $var }} |
Attribute-escaped echo |
{{u $var }} |
URL-encoded echo |
{{c $var }} |
CSS-escaped echo |
{{j $var }} |
JS-escaped echo |
Whitespace control is supported with ~ on either side:
<ul>
{{~ foreach ($items as $item): ~}}
<li>{{h $item}}</li>
{{~ endforeach ~}}
</ul>
Clone or download this repository into VS Code's extensions folder:
git clone https://github.com/qiqphp/vscode-qiq ~/.vscode/extensions/qiq-syntax
Then reload VS Code (Cmd+Shift+P / Ctrl+Shift+P > "Developer: Reload Window").
To uninstall, remove the extension folder:
rm -rf ~/.vscode/extensions/qiq-syntax
GitHub-Flavored Markdown does not recognize qiq as a language, so ```qiq fenced code blocks will not be syntax-highlighted on GitHub. Workarounds:
- Use
```phpfencing for partial highlighting (HTML and<?php ?>tags will highlight, but{{ }}Qiq tags will not) - Use no language identifier for plain, unhighlighted code blocks
To work on the extension, clone the repo and symlink it into VS Code's extensions folder:
git clone https://github.com/qiqphp/vscode-qiq
ln -s /path/to/vscode-qiq ~/.vscode/extensions/qiq-syntax
npm install
npm test
Tests use vscode-tmgrammar-test to verify grammar scopes against annotated .test.qiq.php fixture files in test/.