SilverStripe Template Language Support

Compatible with: IntelliJ IDEA PhpStorm
Apr 27, 2017
26 915
SilverStripe template language support

Issues, feature requests and contributions welcome:

Recent change notes

  • Changes
  • Remove the automatic $ creation
  • Bugfixes
  • Turn off type provider. Fixes #66
  • Fix version file not found. Fixes #67
  • Bugfixes
  • Fix null pointer in class search
  • Set never changed in cache provider
  • Tested with PHPStorm 7.1.4 and 8.0.1
Version 0.9.1
  • Features
  • Fixed concurrency issues in variable resolves
  • Exclude test classes from resolves
  • Create live template context for SilverStripe templates
  • Bundled live templates for all the common tags
Version 0.9
  • Features
  • PHPStorm 6.0.1+ only
  • Total parser rewrite
  • Theme dir and theme file resolves
  • Fix bug in translation identifiers
  • Expanded variable resolves. Ctrl+clicking variables now also checks the db, has_one, has_many, many_many and belongs_many_many arrays.
Version 0.8.1
  • Features
  • Surround descriptors. By pressing ctrl+alt+t you can surround selected text with either an if, loop or with statement.
Version 0.8
  • Features
  • Variables are named elements
  • Variable resolves. Ctrl+click will now try to resolve to a method with that name or a method prefixed by get.
Version 0.7.2
  • Features
  • Project component for tracking SilverStripe version
  • Readded refactor to include insertion of include tag
Version 0.7.1
  • Features
  • Underscores are now valid in variable names.
  • References added to require tag. The file names are now ctrl+clickable leading to the file in question. themedCSS is currently NOT theme aware and will suggest all matches.
Version 0.7
  • Features
  • Annotates free strings to allow easy conversion to strings or variables.
  • Added <, <=, >, >= comparison operators with a warning if they are used in SilverStripe versions lower than 3.1.
  • Added require tag.
  • Fixed fatal error in include refactor when a project is opened without an open file.
  • Change highlighting colors to align more with PHP.
Version 0.6.1
  • Features
  • Fixes reformat bug after removing text when refactoring to include file.
  • Correctly parses advanced versions of loop, with and control.
  • "<" is no longer interpreted as a bad character.
  • Typing "{" should now consistently yield "{$}".
Version 0.6
  • Features
  • Refactor selected text to include file. This command moves the selected text to an include file. Defaults to ctrl+F6.
  • Fix parser bug for else_if statements.
Version 0.5.1
  • Features
  • Major bugfix that would freeze the lexer in some cases.
  • Add YAML references for translations. It is now possible to ctrl+click an element in a yaml translation file to find the corresponding tag.
  • Gutter icon removed for include files.
Version 0.5
  • Features
  • Added the cached tag
  • Proper parsing of translation tags
  • Custom error messages for translation tag
  • Parse advanced include statments
  • Proper parsing of var statements
  • Basic spellchecking
  • Auto focus for autocomplete
  • Bug fix in formatter
Version 0.4
  • Features
  • Proper file resolution for include statements. It's now possible to ctrl+click or command+click include statements directly to navigate to the correct file. We're keeping the icon in the gutter for clarity
  • Bugfix for autocomplete of block statements. This both fixes a bug that missed the autocomplete and caused an exception when searching for files in some cases
Version 0.3
  • Features
  • Code completion for include statement. It will show a list of possible include files in the current project
  • Annotation and quickfix of missing include files. A missing file will be annotated and can be quickfixed to automatically create the file
  • Goto include file. Correct include statement shows a marker in the gutter that when clicked leads to the file
  • Comments support. The plugin now supports the Code -> Comment shortcuts and will create an SS shortcut around the selected text
Version 0.2
  • Features
  • Code completion for block statements Writing out the opening statement will autocomplete the closing statement
  • Automatic placing of caret when pressing enter between start and close block
  • Code formatting for both HTML and the SilverStripe template language.
  • Proper parsing of if/else_if statements
  • Basic support of <%t %>
Version 0.1
First version of the plugin. It brings basic tag recognition, syntax highlighting, brace matching and code folding. It also recognizes HTML as a separate language and allows the formatting of HTML inside an ss file.
  • Features
  • Basic tag recognition. Recognizes the following tags:
    • <% if $Var %> - <% else_if %> - <% else %> - <% end_if %>
    • <% loop $Var %> - <% end_loop %>
    • <% with $Var %> - <% end_with %>
    • <% control $Var %> - <% end_control %>
    • <%-- Comment --%>
    • <% include File %>
    • <% base_tag %>
    • Var statements, both {$Var} and $Var is supported.
  • Basic syntax highlighting
  • Brace matching
  • Code folding
  • HTML is recognized and can be formatted.
  • Error messages for mismatching blocks and unexpected blocks.
    Error messages for syntax errors in Var statements.
  • Message about unrecognized tags.