Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
craigmaslowski committed Nov 19, 2015
0 parents commit 33e1325
Show file tree
Hide file tree
Showing 6 changed files with 326 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Created by https://www.gitignore.io/api/osx

### OSX ###
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// A launch configuration that compiles the extension and then opens it inside a new window
{
"version": "0.1.0",
"configurations": [
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ]
}
]
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Syntax highlighting for ERB files
14 changes: 14 additions & 0 deletions erb.configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"comments": {
// symbol used for single line comment. Remove this entry if your language does not support line comments
"lineComment": "//",
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
"blockComment": [ "/*", "*/" ]
},
// symbols used as brackets
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
]
}
25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "erb",
"description": "Syntax Highlighting for Ruby ERB files",
"version": "0.0.1",
"publisher": "Craig Maslowski",
"engines": {
"vscode": "^0.10.1"
},
"categories": [
"Languages"
],
"contributes": {
"languages": [{
"id": "erb",
"aliases": ["Ruby ERB", "erb"],
"extensions": [".erb",".rhtml",".html.erb"],
"configuration": "./erb.configuration.json"
}],
"grammars": [{
"language": "erb",
"scopeName": "text.html.erb",
"path": "./syntaxes/erb.tmLanguage"
}]
}
}
245 changes: 245 additions & 0 deletions syntaxes/erb.tmLanguage
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>erb</string>
<string>rhtml</string>
<string>html.erb</string>
</array>
<key>injections</key>
<dict>
<key>text.html.erb - (meta.embedded.block.erb | meta.embedded.line.erb | comment)</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>(^\s*)(?=&lt;%+#(?![^%]*%&gt;))</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.comment.leading.erb</string>
</dict>
</dict>
<key>end</key>
<string>(?!\G)(\s*$\n)?</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.comment.trailing.erb</string>
</dict>
</dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#comment</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(^\s*)(?=&lt;%(?![^%]*%&gt;))</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.embedded.leading.erb</string>
</dict>
</dict>
<key>end</key>
<string>(?!\G)(\s*$\n)?</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.embedded.trailing.erb</string>
</dict>
</dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#tags</string>
</dict>
</array>
</dict>
<dict>
<key>include</key>
<string>#comment</string>
</dict>
<dict>
<key>include</key>
<string>#tags</string>
</dict>
</array>
</dict>
</dict>
<key>keyEquivalent</key>
<string>^~H</string>
<key>name</key>
<string>HTML (Ruby - ERB)</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>text.html.basic</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>comment</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>&lt;%+#</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.begin.erb</string>
</dict>
</dict>
<key>end</key>
<string>%&gt;</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.end.erb</string>
</dict>
</dict>
<key>name</key>
<string>comment.block.erb</string>
</dict>
</array>
</dict>
<key>tags</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>&lt;%+(?!&gt;)[-=]?(?![^%]*%&gt;)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.section.embedded.begin.erb</string>
</dict>
</dict>
<key>contentName</key>
<string>source.ruby</string>
<key>end</key>
<string>(-?%)&gt;</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.section.embedded.end.erb</string>
</dict>
<key>1</key>
<dict>
<key>name</key>
<string>source.ruby</string>
</dict>
</dict>
<key>name</key>
<string>meta.embedded.block.erb</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.erb</string>
</dict>
</dict>
<key>match</key>
<string>(#).*?(?=-?%&gt;)</string>
<key>name</key>
<string>comment.line.number-sign.erb</string>
</dict>
<dict>
<key>include</key>
<string>source.ruby</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>&lt;%+(?!&gt;)[-=]?</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.section.embedded.begin.erb</string>
</dict>
</dict>
<key>contentName</key>
<string>source.ruby</string>
<key>end</key>
<string>(-?%)&gt;</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.section.embedded.end.erb</string>
</dict>
<key>1</key>
<dict>
<key>name</key>
<string>source.ruby</string>
</dict>
</dict>
<key>name</key>
<string>meta.embedded.line.erb</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.erb</string>
</dict>
</dict>
<key>match</key>
<string>(#).*?(?=-?%&gt;)</string>
<key>name</key>
<string>comment.line.number-sign.erb</string>
</dict>
<dict>
<key>include</key>
<string>source.ruby</string>
</dict>
</array>
</dict>
</array>
</dict>
</dict>
<key>scopeName</key>
<string>text.html.erb</string>
<key>uuid</key>
<string>13FF9439-15D0-4E74-9A8E-83ABF0BAA5E7</string>
</dict>
</plist>

0 comments on commit 33e1325

Please sign in to comment.