Permalink
Browse files

Version 0.7

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 open without an open
file.
Change highlighting colors to align more with PHP.
Closes #31.
Closes #32.
Closes #33.
  • Loading branch information...
1 parent cabac1c commit 96a444a86d18ae40509a3269f0b35745322cc8f3 @MarcusDalgren MarcusDalgren committed Apr 10, 2013
View
@@ -1,8 +1,10 @@
<idea-plugin version="2" url="https://github.com/raket/idea-silverstripe">
<id>com.raket.silverstripe</id>
<name>SilverStripe Template Language Support</name>
- <version>0.6.1</version>
- <vendor logo="/icons/raket.png" email="marcus@raket.nu" url="https://github.com/raket/idea-silverstripe">Raket Webbyrå</vendor>
+ <version>0.7</version>
+ <vendor logo="/icons/raket.png" email="marcus@raket.nu" url="https://github.com/raket/idea-silverstripe">Raket
+ Webbyrå
+ </vendor>
<description><![CDATA[
<a href="http://www.silverstripe.org/">SilverStripe</a> template language support<br>
@@ -13,26 +15,35 @@
<category>Custom Languages</category>
<change-notes>
<![CDATA[
+ <strong>Version 0.7</strong>
+ <ul>
+ <li><b>Features</b></li>
+ <li>Annotates free strings to allow easy conversion to strings or variables.</li>
+ <li>Added <, <=, >, >= comparison operators with a warning if they are used in SilverStripe versions lower than 3.1.</li>
+ <li>Added require tag.</li>
+ <li>Fixed fatal error in include refactor when a project is opened without an open file.</li>
+ <li>Change highlighting colors to align more with PHP.</li>
+ </ul>
<strong>Version 0.6.1</strong>
<ul>
<li><b>Features</b></li>
<li>Fixes reformat bug after removing text when refactoring to include file.</li>
<li>Correctly parses advanced versions of loop, with and control.</li>
- <li>"<" is no longer interpreted as a bad character</li>
- <li>Typing "{" should now consistently yield "{$}"</li>
+ <li>"<" is no longer interpreted as a bad character.</li>
+ <li>Typing "{" should now consistently yield "{$}".</li>
</ul>
<strong>Version 0.6</strong>
<ul>
<li><b>Features</b></li>
<li>Refactor selected text to include file. This command moves the selected text to an include file. Defaults to ctrl+F6.</li>
- <li>Fix parser bug for else_if statements</li>
+ <li>Fix parser bug for else_if statements.</li>
</ul>
<strong>Version 0.5.1</strong>
<ul>
<li><b>Features</b></li>
- <li>Major bugfix that would freeze the lexer in some cases</li>
+ <li>Major bugfix that would freeze the lexer in some cases.</li>
<li>Add YAML references for translations. It is now possible to ctrl+click an element in a yaml translation file to find the corresponding tag.</li>
- <li>Gutter icon removed for include files</li>
+ <li>Gutter icon removed for include files.</li>
</ul>
<strong>Version 0.5</strong>
<ul>
@@ -128,7 +139,8 @@
description="Add a new SilverStripe Template File">
<add-to-group group-id="NewGroup" anchor="after" relative-to-action="NewFile"/>
</action>
- <action id="IncludeRefactor" class="com.raket.silverstripe.editor.actions.SilverStripeIncludeRefactorAction" text="Refactor to include file">
+ <action id="IncludeRefactor" class="com.raket.silverstripe.editor.actions.SilverStripeIncludeRefactorAction"
+ text="Refactor to include file">
<add-to-group group-id="IntroduceActionsGroup" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="ctrl F6"/>
</action>
@@ -160,19 +172,24 @@
implementationClass="com.raket.silverstripe.editor.annotations.SilverStripeIncludeAnnotator"/>
<annotator language="SilverStripe"
implementationClass="com.raket.silverstripe.editor.annotations.SilverStripeTranslationAnnotator"/>
+ <annotator language="SilverStripe"
+ implementationClass="com.raket.silverstripe.editor.annotations.SilverStripeVariableAnnotator"/>
+ <annotator language="SilverStripe"
+ implementationClass="com.raket.silverstripe.editor.annotations.SilverStripeComparisonAnnotator"/>
<lang.commenter language="SilverStripe"
implementationClass="com.raket.silverstripe.editor.comments.SilverStripeCommenter"/>
<spellchecker.support language="SilverStripe"
implementationClass="com.intellij.spellchecker.tokenizer.SpellcheckingStrategy"/>
<psi.referenceContributor
- implementation="com.raket.silverstripe.references.SilverStripeReferenceContributor"/>
+ implementation="com.raket.silverstripe.references.SilverStripeReferenceContributor"/>
<psi.referenceContributor
implementation="com.raket.silverstripe.references.SilverStripeYamlReferenceContributor"/>
- <editorHighlighterProvider filetype="SilverStripe" implementationClass="com.raket.silverstripe.editor.highlighting.SilverStripeEditorHighlighterProvider"/>
- <!--
- <lang.syntaxHighlighterFactory key="SilverStripe" implementationClass="com.raket.silverstripe.editor.highlighting.SilverStripeSyntaxHighlighterFactory"/>
- <codeInsight.lineMarkerProvider language="SilverStripe"
- implementationClass="com.raket.silverstripe.editor.lines.SilverStripeLineMarkerProvider"/>
- -->
+ <editorHighlighterProvider filetype="SilverStripe"
+ implementationClass="com.raket.silverstripe.editor.highlighting.SilverStripeEditorHighlighterProvider"/>
+ <!--
+ <lang.syntaxHighlighterFactory key="SilverStripe" implementationClass="com.raket.silverstripe.editor.highlighting.SilverStripeSyntaxHighlighterFactory"/>
+ <codeInsight.lineMarkerProvider language="SilverStripe"
+ implementationClass="com.raket.silverstripe.editor.lines.SilverStripeLineMarkerProvider"/>
+ -->
</extensions>
</idea-plugin>
View
Binary file not shown.
@@ -13,3 +13,5 @@ ss.newfile.menu.action.description=Creates a new SilverStripe File
ss.annotations.file.not.found=Could not find include file "{0}".
ss.annotations.translation.no.identifier=Missing identifier in translation tag
ss.annotations.translation.no.parameter.match=The parameters do not match up. Please add "{0}".
+ss.annotations.freestring.var=This variable is missing $. Either turn it into a string or add the $.
+ss.annotations.comparison.not.supported=< and > operators are only supported in SilverStripe 3.1 and up.
@@ -69,7 +69,7 @@ SS_START_KEYWORD= loop | with | control
SS_IF_KEYWORD= if
SS_ELSE_IF_KEYWORD= else_if
SS_ELSE_KEYWORD= else
-SS_COMPARISON_OPERATOR= "==" | "!=" | "=" | "not"
+SS_COMPARISON_OPERATOR= "==" | "!=" | "=" | "not" | ">" | "<" | ">=" | "<="
SS_AND_OR_OPERATOR= "&&" | "||"
SS_STRING= \"[^\"]*\" | \'[^\']*\'
SS_DOUBLE_WITH_VAR= [^\"{]*
@@ -106,6 +106,7 @@ SS_TRANSLATION_IDENTIFIER= [a-zA-Z]+\.[a-zA-Z]+
%state SS_DOUBLE
%state SS_SINGLE
%state SS_REQUIRE_CONTENT
+%state SS_IDENTIFIER
%%
<YYINITIAL> {
@@ -189,7 +190,6 @@ SS_TRANSLATION_IDENTIFIER= [a-zA-Z]+\.[a-zA-Z]+
{SS_COMPARISON_OPERATOR} { return SilverStripeTypes.SS_COMPARISON_OPERATOR; }
{SS_AND_OR_OPERATOR} { return SilverStripeTypes.SS_AND_OR_OPERATOR; }
{SS_STRING} { return SilverStripeTypes.SS_STRING; }
- {NUMBER} { return SilverStripeTypes.NUMBER; }
{VAR} { yypushstate(SS_VAR); return SilverStripeTypes.SS_VAR; }
{SS_BLOCK_END} { yycleanstates(); return SilverStripeTypes.SS_BLOCK_END; }
}
@@ -245,7 +245,7 @@ SS_TRANSLATION_IDENTIFIER= [a-zA-Z]+\.[a-zA-Z]+
{SS_VAR_START_DELIMITER} { return SilverStripeTypes.SS_VAR_START_DELIMITER; }
"$" { return SilverStripeTypes.SS_VAR_START; }
{VAR} { return SilverStripeTypes.SS_VAR; }
- {DOT} { return SilverStripeTypes.DOT; }
+ {DOT} { yypushstate(SS_IDENTIFIER); return SilverStripeTypes.DOT; }
{LEFT_PAREN} { yypushstate(SS_METHOD_ARGUMENTS); return SilverStripeTypes.LEFT_PAREN; }
{SS_VAR_END_DELIMITER} { yypopstate(); return SilverStripeTypes.SS_VAR_END_DELIMITER; }
@@ -256,14 +256,17 @@ SS_TRANSLATION_IDENTIFIER= [a-zA-Z]+\.[a-zA-Z]+
<SS_METHOD_ARGUMENTS> {
{COMMA} { return SilverStripeTypes.COMMA; }
{VAR} { return SilverStripeTypes.SS_VAR; }
- {DOT} { return SilverStripeTypes.DOT; }
+ {DOT} { yypushstate(SS_IDENTIFIER); return SilverStripeTypes.DOT; }
{SS_STRING} { return SilverStripeTypes.SS_STRING; }
{NUMBER} { return SilverStripeTypes.NUMBER; }
{RIGHT_PAREN} { yypopstate(); return SilverStripeTypes.RIGHT_PAREN; }
{WHITE_SPACE}+ { return TokenType.WHITE_SPACE; }
. { yypopstate(); yypushback(yylength()); }
}
-
+<SS_IDENTIFIER> {
+ [a-zA-Z_]+([a-zA-Z0-9_])* { yypopstate(); return SilverStripeTypes.SS_IDENTIFIER; }
+ . { yypopstate(); yypushback(yylength()); }
+}
{WHITE_SPACE}+ { return TokenType.WHITE_SPACE; }
{CRLF}
{
Oops, something went wrong.

0 comments on commit 96a444a

Please sign in to comment.