-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
242 additions
and
12 deletions.
There are no files selected for viewing
File renamed without changes.
156 changes: 156 additions & 0 deletions
156
eclipse-solargraph-plugin/grammar/js_erb.tmLanguage.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
{ | ||
"version": "https://github.com/textmate/ruby-on-rails-tmbundle/commit/4efef9bfea373a26044f5dd69069cb68d6232baf", | ||
"name": "JS (Ruby - ERB)", | ||
"scopeName": "source.js.erb.rails", | ||
"fileTypes": [ | ||
"js.erb" | ||
], | ||
"injections": { | ||
"L:source.js.erb.rails - (meta.embedded.block.erb | meta.embedded.line.erb | comment)": { | ||
"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" | ||
} | ||
] | ||
} | ||
}, | ||
"keyEquivalent": "^~J", | ||
"name": "JavaScript (Rails)", | ||
"patterns": [ | ||
{ | ||
"include": "source.js" | ||
} | ||
], | ||
"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", | ||
"end": "(-?%)>", | ||
"endCaptures": { | ||
"0": { | ||
"name": "punctuation.section.embedded.end.erb" | ||
}, | ||
"1": { | ||
"name": "source.ruby.rails" | ||
} | ||
}, | ||
"name": "meta.embedded.block.erb", | ||
"patterns": [ | ||
{ | ||
"captures": { | ||
"1": { | ||
"name": "punctuation.definition.comment.erb" | ||
} | ||
}, | ||
"match": "(#).*?(?=-?%>)", | ||
"name": "comment.line.number-sign.erb" | ||
}, | ||
{ | ||
"include": "source.ruby.rails" | ||
} | ||
] | ||
}, | ||
{ | ||
"begin": "<%+(?!>)[-=]?", | ||
"beginCaptures": { | ||
"0": { | ||
"name": "punctuation.section.embedded.begin.erb" | ||
} | ||
}, | ||
"contentName": "source.ruby", | ||
"end": "(-?%)>", | ||
"endCaptures": { | ||
"0": { | ||
"name": "punctuation.section.embedded.end.erb" | ||
}, | ||
"1": { | ||
"name": "source.ruby.rails.ruby" | ||
} | ||
}, | ||
"name": "meta.embedded.line.erb", | ||
"patterns": [ | ||
{ | ||
"captures": { | ||
"1": { | ||
"name": "punctuation.definition.comment.erb" | ||
} | ||
}, | ||
"match": "(#).*?(?=-?%>)", | ||
"name": "comment.line.number-sign.erb" | ||
}, | ||
{ | ||
"include": "source.ruby.rails" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* This is about <code>Example.js</code>. | ||
* {@link com.yourCompany.aPackage.aFile} | ||
* @author author | ||
* @deprecated use <code>BetterExample.js</code> | ||
*/ | ||
var index = 0; | ||
var arr = []; | ||
var rbs = "<%= rbstring %>"; | ||
|
||
function foo() { | ||
/* This comment may span multiple lines. */ | ||
var var1 = new Object(); | ||
var obj = { carMake: 'Amet', carModel: 'Porro', carYear: 2012 }; | ||
var s = "abc123"; | ||
clear(var1); | ||
var template = `This is a template literal value, | ||
it may span multiple lines.`; | ||
} | ||
|
||
function pop() { | ||
return arr[index--]; | ||
} | ||
|
||
function push(elem) { | ||
// This comment may span only this line | ||
arr[index++] = elem; | ||
} | ||
|
||
function isEmpty() { | ||
// TASK: refactor | ||
return index == 0; | ||
} |