Closed radnor closed 9 years ago
So the bug has to do with the language grammar. In language-javascript, :
has an operator
scope which allows aligner to determine how to align these characters.
If you can get me the scope of :
in language-bable
, that would be great!
According to Babel Language.json this is how :
is treated. There are a few other instances in the file as well... hope this helps! :smile:
"literal-regexp": {
"patterns": [
{
"name": "string.regexp.js",
"begin": "(?<=\\.|\\(|,|{|}|\\[|;|,|<|>|<=|>=|==|!=|===|!==|\\+|-|\\*|%|\\+\\+|--|<<|>>|>>>|&|\\||\\^|!|~|&&|\\|\\||\\?|:|=|\\+=|-=|\\*=|%=|<<=|>>=|>>>=|&=|\\|=|\\^=|/|/=|\\Wnew|\\Wdelete|\\Wvoid|\\Wtypeof|\\Winstanceof|\\Win|\\Wdo|\\Wreturn|\\Wcase|\\Wthrow|^new|^delete|^void|^typeof|^instanceof|^in|^do|^return|^case|^throw|^)\\s*(/)(?!/|\\*|$)",
"end": "(/)([gimy]*)",
"beginCaptures": {
"1": { "name": "punctuation.definition.string.begin.js" }
},
"endCaptures": {
"1": { "name": "punctuation.definition.string.end.js" },
"2": { "name": "keyword.other.js" }
},
"patterns": [
{ "include": "source.regexp.babel" }
]
}
]
},
There seems to be multiple definitions for :
depending on the type of the value but they are all separator.key-value
.
I have updated aligner but there are some testing issues at the moment. I'll be releasing the new version once those are resolved.
How can I make it so that aligner treats the Babel ES6 Javascript language from language-babel correctly?
Here's my original object.
If I'm set to
Babel ES6 JavaScript
from language-babel I get this alignment.If I set the language to
JavaScript
I get this (proper) alignment.