Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #187 from Shopify/vs/bundle_grammars
Browse files Browse the repository at this point in the history
Bundle grammar files
  • Loading branch information
vinistock authored Aug 16, 2022
2 parents 2ca6d25 + 8820e0c commit 1e7f4aa
Show file tree
Hide file tree
Showing 5 changed files with 3,366 additions and 0 deletions.
20 changes: 20 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,23 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

================================================================================
The following files and related configuration in package.json are based on a
sequence of adaptions: grammars/ruby.cson.json, grammars/erb.cson.json,
languages/erb.json.

Copyright (c) 2016 Peng Lv
Copyright (c) 2017-2019 Stafford Brunk
https://github.com/rubyide/vscode-ruby

Released under the MIT license
https://github.com/rubyide/vscode-ruby/blob/main/LICENSE.txt

Copyright (c) 2014 GitHub Inc.
https://github.com/atom/language-ruby

Released under the MIT license
https://github.com/atom/language-ruby/blob/master/LICENSE.md

https://github.com/textmate/ruby.tmbundle
https://github.com/textmate/ruby.tmbundle#license
151 changes: 151 additions & 0 deletions grammars/erb.cson.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{
"name": "HTML (Ruby - ERB)",
"scopeName": "text.html.erb",
"fileTypes": ["rhtml", "html.erb"],
"injections": {
"text.html.erb - (meta.embedded.block.erb | meta.embedded.line.erb | meta.tag | comment), L:meta.tag, L:source.js.embedded.html": {
"patterns": [
{
"begin": "(^\\s*)(?=<%+#(?![^%]*%>))",
"beginCaptures": {
"0": {
"name": "punctuation.whitespace.comment.leading.erb"
}
},
"end": "(?!\\G)(\\s*$\\n)?",
"endCaptures": {
"0": {
"name": "punctuation.whitespace.comment.trailing.erb"
}
},
"patterns": [
{
"include": "#comment"
}
]
},
{
"begin": "(^\\s*)(?=<%(?![^%]*%>))",
"beginCaptures": {
"0": {
"name": "punctuation.whitespace.embedded.leading.erb"
}
},
"end": "(?!\\G)(\\s*$\\n)?",
"endCaptures": {
"0": {
"name": "punctuation.whitespace.embedded.trailing.erb"
}
},
"patterns": [
{
"include": "#tags"
}
]
},
{
"include": "#comment"
},
{
"include": "#tags"
}
]
}
},
"patterns": [
{
"include": "text.html.basic"
}
],
"repository": {
"comment": {
"patterns": [
{
"begin": "<%+#",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.begin.erb"
}
},
"end": "%>",
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.end.erb"
}
},
"name": "comment.block.erb"
}
]
},
"tags": {
"patterns": [
{
"begin": "<%+(?!>)[-=]?(?![^%]*%>)",
"beginCaptures": {
"0": {
"name": "punctuation.section.embedded.begin.erb"
}
},
"contentName": "source.ruby.embedded.erb",
"end": "-?%>",
"endCaptures": {
"0": {
"name": "punctuation.section.embedded.end.erb"
},
"1": {
"name": "source.ruby"
}
},
"name": "meta.embedded.block.erb",
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.comment.erb"
}
},
"match": "(#).*?(?=-?%>)",
"name": "comment.line.number-sign.erb"
},
{
"include": "source.ruby"
}
]
},
{
"begin": "<%+(?!>)[-=]?",
"beginCaptures": {
"0": {
"name": "punctuation.section.embedded.begin.erb"
}
},
"contentName": "source.ruby.embedded.erb",
"end": "-?%>",
"endCaptures": {
"0": {
"name": "punctuation.section.embedded.end.erb"
},
"1": {
"name": "source.ruby"
}
},
"name": "meta.embedded.line.erb",
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.comment.erb"
}
},
"match": "(#).*?(?=-?%>)",
"name": "comment.line.number-sign.erb"
},
{
"include": "source.ruby"
}
]
}
]
}
}
}
Loading

0 comments on commit 1e7f4aa

Please sign in to comment.