Skip to content
Browse files

fixed some erb issues

  • Loading branch information...
1 parent 48784d7 commit 751417fd4e02e2549832f963d87cf72876fb7c6e @grigio grigio committed
Showing with 36 additions and 349 deletions.
  1. +20 −349 erb.lang
  2. +9 −0 rails.xml
  3. +7 −0 snippets/erb.xml
View
369 erb.lang
@@ -1,352 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<language id="erb" _name="erb" version="2.0" _section="Markup">
- <metadata>
- <property name="mimetypes">text/erb</property>
- </metadata>
-
- <styles>
- <style id="comment" _name="Comment" map-to="def:comment"/>
- <style id="string" _name="String" map-to="def:string"/>
- <style id="keyword" _name="Keyword" map-to="def:keyword"/>
- <style id="decimal" _name="Decimal" map-to="def:decimal"/>
- <style id="data-type" _name="Data Type" map-to="def:type"/>
- <style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/>
- <style id="others" _name="Others"/>
- </styles>
-
- <definitions>
- <context id="block-comment" style-ref="comment">
- <start>&lt;!--</start>
- <end>--&gt;</end>
- </context>
- <context id="double-quoted-string" style-ref="string" end-at-line-end="true">
- <start>"</start>
- <end>"</end>
- </context>
- <context id="single-quoted-string" style-ref="string" end-at-line-end="true">
- <start>'</start>
- <end>'</end>
- </context>
- <context id="erb-tag" style-ref="others">
- <match>&lt;(%(=)?)</match>
- </context>
- <context id="erb-closing-tag" style-ref="others">
- <match>%&gt;</match>
- </context>
- <context id="ruby" style-ref="keyword">
- <keyword>BEGIN</keyword>
- <keyword>END</keyword>
- <keyword>and</keyword>
- <keyword>begin</keyword>
- <keyword>break</keyword>
- <keyword>case</keyword>
- <keyword>catch</keyword>
- <keyword>defined?</keyword>
- <keyword>do</keyword>
- <keyword>else</keyword>
- <keyword>elsif</keyword>
- <keyword>end</keyword>
- <keyword>ensure</keyword>
- <keyword>for</keyword>
- <keyword>if</keyword>
- <keyword>in</keyword>
- <keyword>next</keyword>
- <keyword>not</keyword>
- <keyword>or</keyword>
- <keyword>private</keyword>
- <keyword>protected</keyword>
- <keyword>public</keyword>
- <keyword>redo</keyword>
- <keyword>rescue</keyword>
- <keyword>retry</keyword>
- <keyword>return</keyword>
- <keyword>then</keyword>
- <keyword>throw</keyword>
- <keyword>unless</keyword>
- <keyword>until</keyword>
- <keyword>when</keyword>
- <keyword>while</keyword>
- <keyword>yield</keyword>
- </context>
- <context id="pseudo-variables" style-ref="data-type">
- <keyword>self</keyword>
- <keyword>super</keyword>
- <keyword>nil</keyword>
- <keyword>false</keyword>
- <keyword>true</keyword>
- <keyword>__FILE__</keyword>
- <keyword>__LINE__</keyword>
- </context>
- <context id="module-handlers" style-ref="preprocessor">
- <keyword>require</keyword>
- <keyword>include</keyword>
- <keyword>load</keyword>
- </context>
- <context id="closing-bracket" style-ref="keyword">
- <match>&gt;</match>
- </context>
- <context id="implies" style-ref="keyword">
- <match>=&gt;</match>
- </context>
- <context id="tag" style-ref="keyword">
- <prefix>&lt;/?</prefix>
- <suffix>(\b|&gt;)</suffix>
- <keyword>a</keyword>
- <keyword>abbr</keyword>
- <keyword>acronym</keyword>
- <keyword>address</keyword>
- <keyword>applet</keyword>
- <keyword>area</keyword>
- <keyword>b</keyword>
- <keyword>base</keyword>
- <keyword>basefont</keyword>
- <keyword>bdo</keyword>
- <keyword>big</keyword>
- <keyword>blockquote</keyword>
- <keyword>body</keyword>
- <keyword>br</keyword>
- <keyword>button</keyword>
- <keyword>caption</keyword>
- <keyword>center</keyword>
- <keyword>cite</keyword>
- <keyword>code</keyword>
- <keyword>col</keyword>
- <keyword>colgroup</keyword>
- <keyword>dd</keyword>
- <keyword>del</keyword>
- <keyword>dfn</keyword>
- <keyword>dir</keyword>
- <keyword>div</keyword>
- <keyword>dl</keyword>
- <keyword>dt</keyword>
- <keyword>em</keyword>
- <keyword>fieldset</keyword>
- <keyword>font</keyword>
- <keyword>form</keyword>
- <keyword>frame</keyword>
- <keyword>frameset</keyword>
- <keyword>h[1-6]</keyword>
- <keyword>head</keyword>
- <keyword>hr</keyword>
- <keyword>html</keyword>
- <keyword>i</keyword>
- <keyword>iframe</keyword>
- <keyword>img</keyword>
- <keyword>input</keyword>
- <keyword>ins</keyword>
- <keyword>kbd</keyword>
- <keyword>label</keyword>
- <keyword>legend</keyword>
- <keyword>li</keyword>
- <keyword>link</keyword>
- <keyword>map</keyword>
- <keyword>menu</keyword>
- <keyword>meta</keyword>
- <keyword>noframes</keyword>
- <keyword>noscript</keyword>
- <keyword>object</keyword>
- <keyword>ol</keyword>
- <keyword>optgroup</keyword>
- <keyword>option</keyword>
- <keyword>p</keyword>
- <keyword>param</keyword>
- <keyword>pre</keyword>
- <keyword>q</keyword>
- <keyword>s</keyword>
- <keyword>samp</keyword>
- <keyword>script</keyword>
- <keyword>select</keyword>
- <keyword>small</keyword>
- <keyword>span</keyword>
- <keyword>strike</keyword>
- <keyword>strong</keyword>
- <keyword>style</keyword>
- <keyword>sub</keyword>
- <keyword>sup</keyword>
- <keyword>table</keyword>
- <keyword>tbody</keyword>
- <keyword>td</keyword>
- <keyword>text</keyword>
- <keyword>textarea</keyword>
- <keyword>tfoot</keyword>
- <keyword>th</keyword>
- <keyword>thead</keyword>
- <keyword>title</keyword>
- <keyword>tr</keyword>
- <keyword>tt</keyword>
- <keyword>u</keyword>
- <keyword>ul</keyword>
- <keyword>var</keyword>
- </context>
- <context id="attribute" style-ref="others">
- <suffix>[ \t]*=</suffix>
- <keyword>attr</keyword>
- <keyword>attr_writer</keyword>
- <keyword>attr_reader</keyword>
- <keyword>attr_accessor</keyword>
- <keyword>abbr</keyword>
- <keyword>accept-charset</keyword>
- <keyword>accept</keyword>
- <keyword>accesskey</keyword>
- <keyword>action</keyword>
- <keyword>align</keyword>
- <keyword>alink</keyword>
- <keyword>alt</keyword>
- <keyword>archive</keyword>
- <keyword>axis</keyword>
- <keyword>background</keyword>
- <keyword>bgcolor</keyword>
- <keyword>border</keyword>
- <keyword>cellpadding</keyword>
- <keyword>cellspacing</keyword>
- <keyword>char</keyword>
- <keyword>charoff</keyword>
- <keyword>charset</keyword>
- <keyword>checked</keyword>
- <keyword>cite</keyword>
- <keyword>class</keyword>
- <keyword>classid</keyword>
- <keyword>clear</keyword>
- <keyword>code</keyword>
- <keyword>codebase</keyword>
- <keyword>codetype</keyword>
- <keyword>color</keyword>
- <keyword>cols</keyword>
- <keyword>colspan</keyword>
- <keyword>content</keyword>
- <keyword>coords</keyword>
- <keyword>data</keyword>
- <keyword>datetime</keyword>
- <keyword>declare</keyword>
- <keyword>defer</keyword>
- <keyword>dir</keyword>
- <keyword>disabled</keyword>
- <keyword>enctype</keyword>
- <keyword>face</keyword>
- <keyword>for</keyword>
- <keyword>frame</keyword>
- <keyword>frameborder</keyword>
- <keyword>headers</keyword>
- <keyword>height</keyword>
- <keyword>href</keyword>
- <keyword>hreflang</keyword>
- <keyword>hspace</keyword>
- <keyword>http-equiv</keyword>
- <keyword>id</keyword>
- <keyword>ismap</keyword>
- <keyword>label</keyword>
- <keyword>lang</keyword>
- <keyword>language</keyword>
- <keyword>link</keyword>
- <keyword>longdesc</keyword>
- <keyword>marginheight</keyword>
- <keyword>marginwidth</keyword>
- <keyword>maxlength</keyword>
- <keyword>media</keyword>
- <keyword>method</keyword>
- <keyword>multiple</keyword>
- <keyword>name</keyword>
- <keyword>nohref</keyword>
- <keyword>noresize</keyword>
- <keyword>noshade</keyword>
- <keyword>nowrap</keyword>
- <keyword>object</keyword>
- <keyword>onblur</keyword>
- <keyword>onchange</keyword>
- <keyword>onclick</keyword>
- <keyword>ondblclick</keyword>
- <keyword>onfocus</keyword>
- <keyword>onkeydown</keyword>
- <keyword>onkeypress</keyword>
- <keyword>onkeyup</keyword>
- <keyword>onload</keyword>
- <keyword>onmousedown</keyword>
- <keyword>onmousemove</keyword>
- <keyword>onmouseout</keyword>
- <keyword>onmouseover</keyword>
- <keyword>onmouseup</keyword>
- <keyword>onreset</keyword>
- <keyword>onselect</keyword>
- <keyword>onsubmit</keyword>
- <keyword>onunload</keyword>
- <keyword>profile</keyword>
- <keyword>prompt</keyword>
- <keyword>readonly</keyword>
- <keyword>rel</keyword>
- <keyword>rev</keyword>
- <keyword>rows</keyword>
- <keyword>rowspan</keyword>
- <keyword>rules</keyword>
- <keyword>scheme</keyword>
- <keyword>scope</keyword>
- <keyword>scrolling</keyword>
- <keyword>selected</keyword>
- <keyword>shape</keyword>
- <keyword>size</keyword>
- <keyword>span</keyword>
- <keyword>src</keyword>
- <keyword>standby</keyword>
- <keyword>start</keyword>
- <keyword>style</keyword>
- <keyword>summary</keyword>
- <keyword>tabindex</keyword>
- <keyword>target</keyword>
- <keyword>text</keyword>
- <keyword>title</keyword>
- <keyword>type</keyword>
- <keyword>usemap</keyword>
- <keyword>valign</keyword>
- <keyword>value</keyword>
- <keyword>valuetype</keyword>
- <keyword>version</keyword>
- <keyword>vlink</keyword>
- <keyword>vspace</keyword>
- <keyword>width</keyword>
- </context>
- <context id="line-comment" style-ref="comment" end-at-line-end="true">
- <start>#</start>
- </context>
- <context id="multiline-comment" style-ref="comment">
- <start>^=begin</start>
- <end>^=end</end>
- </context>
- <context id="class-variables" style-ref="data-type">
- <match>@@[a-zA-Z_][a-zA-Z0-9_]*</match>
- </context>
- <context id="instance-variables" style-ref="data-type">
- <match>@[a-zA-Z_][a-zA-Z0-9_]*</match>
- </context>
- <context id="global-variables" style-ref="data-type">
- <match>\$[a-zA-Z_][a-zA-Z0-9_]*</match>
- </context>
- <context id="symbols" style-ref="data-type">
- <match>:[a-zA-Z0-9_]+</match>
- </context>
- <context id="regexp-variables" style-ref="decimal">
- <match>\$[1-9][0-9]*</match>
- </context>
- <context id="erb">
- <include>
- <context ref="block-comment"/>
- <context ref="double-quoted-string"/>
- <context ref="single-quoted-string"/>
- <context ref="erb-tag"/>
- <context ref="erb-closing-tag"/>
- <context ref="ruby"/>
- <context ref="pseudo-variables"/>
- <context ref="module-handlers"/>
- <context ref="closing-bracket"/>
- <context ref="implies"/>
- <context ref="tag"/>
- <context ref="attribute"/>
- <context ref="line-comment"/>
- <context ref="multiline-comment"/>
- <context ref="class-variables"/>
- <context ref="instance-variables"/>
- <context ref="global-variables"/>
- <context ref="symbols"/>
- <context ref="regexp-variables"/>
- </include>
- </context>
- </definitions>
+ <metadata>
+ <property name="mimetypes">text/erb</property>
+ <property name="globs">*.erb</property>
+ </metadata>
+ <definitions>
+ <context id="erb-block">
+ <start>&lt;%</start>
+ <end>%&gt;</end>
+ <include>
+ <context ref="ruby:ruby:*"/>
+ </include>
+ </context>
+ <context id="erb">
+ <include>
+ <context ref="html:html"/>
+ <context ref="erb-block"/>
+ </include>
+ </context>
+ </definitions>
</language>
+
View
9 rails.xml
@@ -15,6 +15,15 @@
<comment xml:lang="en">Rakefile</comment>
<glob pattern="Rakefile"/>
</mime-type>
+ <mime-type type="application/x-ruby">
+ <comment>Ruby JavaScript</comment>
+ <glob pattern="*.rjs"/>
+ </mime-type>
+ <mime-type type="application/x-ruby">
+ <comment>Ruby XML Template</comment>
+ <glob pattern="*.rxml"/>
+ <glob pattern="*.builder"/>
+ </mime-type>
<mime-type type="text/x-yaml">
<comment xml:lang="en">YAML</comment>
<glob pattern="*.yml"/>
View
7 snippets/erb.xml
@@ -5,6 +5,7 @@
<tag>erb</tag>
<description>erb &lt;%=</description>
<drop-targets>text/erb, text/html</drop-targets>
+ <accelerator><![CDATA[<Shift><Control>greater]]></accelerator>
</snippet>
<snippet>
<text><![CDATA[<% $0 %>]]></text>
@@ -24,4 +25,10 @@
<description>html tag</description>
<drop-targets>text/erb, text/html</drop-targets>
</snippet>
+ <snippet>
+ <text><![CDATA[:${1:key} => ${2:"value"}${3:, }]]></text>
+ <tag>:</tag>
+ <description>hash pair</description>
+ <drop-targets>text/erb, text/html</drop-targets>
+ </snippet>
</snippets>

0 comments on commit 751417f

Please sign in to comment.
Something went wrong with that request. Please try again.