TextMate grammar files for Smarty 3 for VS Code, Sublime Text, and Atom
npm install @modix/smarty-tmlanguage
sh
npm install @modix/smarty-tmlanguage --save
`
Known restrictions
Currently, the following features of Smarty 3 are not implemented:
- Ternary operator ({$a ? $b : $c})
- Line-breaks within modifiers
- nocache pseudo attribute ({$var nocache})
- Method calls with parentheses ($smarty->clearAllCache())
- Object property accesstor ->
- Object method chaining ({$object->method1($x)->method2($y)})
- Opening and closing {strip} everywhere
The rules have a high understanding of the structure of the document, or with other words, they are very restrictive. This means, if you close a block (e.g. {/if}) without to open it, the highlighter will show that with wrong colorization, because in the case of the {/if}, it assumes that you try to divide nothing by the unquoted string "if", since this operation has higher priority than an unallowed {/if} statement.
The same counts if you open an {if} in a HTML comment, but close it outside, or if a HTML tag is not closed correctly (e.g. {if $link !== ''}My Link