codemirror-mode-icu
Advanced tools
Comparing version
module.exports = { | ||
presets: ['@babel/preset-env', '@babel/preset-typescript'] | ||
presets: ['@babel/preset-env', '@babel/preset-typescript'], | ||
}; |
@@ -52,5 +52,5 @@ "use strict"; | ||
{ | ||
type: 'text' | ||
} | ||
] | ||
type: 'text', | ||
}, | ||
], | ||
}; | ||
@@ -60,3 +60,3 @@ }, | ||
return { | ||
stack: state.stack.map(function (frame) { return Object.assign({}, frame); }) | ||
stack: state.stack.map(function (frame) { return Object.assign({}, frame); }), | ||
}; | ||
@@ -91,3 +91,3 @@ }, | ||
indentation: stream.indentation() + indentUnit, | ||
argPos: 0 | ||
argPos: 0, | ||
}); | ||
@@ -172,5 +172,5 @@ return 'bracket'; | ||
return current.indentation; | ||
} | ||
}, | ||
}; | ||
}; | ||
exports.default = mode; |
{ | ||
"name": "codemirror-mode-icu", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "codemirror language mode for ICU message format", | ||
@@ -19,4 +19,4 @@ "main": "dist/index.js", | ||
"@babel/preset-typescript": "^7.8.3", | ||
"@types/codemirror": "0.0.75", | ||
"@types/jest": "^25.1.1", | ||
"@types/codemirror": "0.0.90", | ||
"@types/jest": "^25.2.1", | ||
"babel-jest": "^25.1.0", | ||
@@ -27,3 +27,3 @@ "codemirror": "^5.50.2", | ||
}, | ||
"gitHead": "fd14895ca00499ce88d5e832a8154f0a38ad0625" | ||
"gitHead": "4661a44c6189f92079727a2c2638924191786ffe" | ||
} |
@@ -51,7 +51,7 @@ /* eslint-env jest */ | ||
const langStr = input | ||
.map(token => { | ||
.map((token) => { | ||
return typeof token === 'string' ? token : token[0]; | ||
}) | ||
.join(''); | ||
const expectedTokens = input.map(token => { | ||
const expectedTokens = input.map((token) => { | ||
return typeof token === 'string' ? [token, null] : token; | ||
@@ -71,3 +71,3 @@ }); | ||
['}', 'bracket'], | ||
['ghi', 'string'] | ||
['ghi', 'string'], | ||
]); | ||
@@ -80,3 +80,3 @@ | ||
['select', 'keyword'], | ||
['}', 'bracket'] | ||
['}', 'bracket'], | ||
]); | ||
@@ -91,3 +91,3 @@ | ||
' ', | ||
['}', 'bracket'] | ||
['}', 'bracket'], | ||
]); | ||
@@ -102,7 +102,7 @@ | ||
['short', 'variable'], | ||
['}', 'bracket'] | ||
['}', 'bracket'], | ||
]); | ||
defineTest('no placeholder detection in top level string', mode, [ | ||
['ab#c', 'string'] | ||
['ab#c', 'string'], | ||
]); | ||
@@ -117,3 +117,3 @@ | ||
["''", 'string-2'], | ||
['t', 'string'] | ||
['t', 'string'], | ||
]); | ||
@@ -123,3 +123,3 @@ | ||
['I see ', 'string'], | ||
["'{many}'", 'string-2'] | ||
["'{many}'", 'string-2'], | ||
]); | ||
@@ -129,3 +129,3 @@ | ||
['I ay ', 'string'], | ||
["'{''wow''}'", 'string-2'] | ||
["'{''wow''}'", 'string-2'], | ||
]); | ||
@@ -157,3 +157,3 @@ } | ||
["'{'", 'string-2'], | ||
['c', 'string'] | ||
['c', 'string'], | ||
]); | ||
@@ -164,3 +164,3 @@ | ||
["'c''d'", 'string-2'], | ||
['e', 'string'] | ||
['e', 'string'], | ||
]); | ||
@@ -171,3 +171,3 @@ | ||
["''", 'string-2'], | ||
['c', 'string'] | ||
['c', 'string'], | ||
]); | ||
@@ -178,3 +178,3 @@ | ||
["'c\n'", 'string-2'], | ||
['d', 'string'] | ||
['d', 'string'], | ||
]); | ||
@@ -185,3 +185,3 @@ | ||
["'\nc'", 'string-2'], | ||
['d', 'string'] | ||
['d', 'string'], | ||
]); | ||
@@ -191,3 +191,3 @@ | ||
['Don', 'string'], | ||
["'t", 'string-2'] | ||
["'t", 'string-2'], | ||
]); | ||
@@ -197,5 +197,5 @@ | ||
['a', 'string'], | ||
["'", 'string-2'] | ||
["'", 'string-2'], | ||
]); | ||
}); | ||
}); |
@@ -75,5 +75,5 @@ import { ModeFactory, StringStream } from 'codemirror'; | ||
{ | ||
type: 'text' | ||
} | ||
] | ||
type: 'text', | ||
}, | ||
], | ||
}; | ||
@@ -84,3 +84,3 @@ }, | ||
return { | ||
stack: state.stack.map(frame => Object.assign({}, frame)) | ||
stack: state.stack.map((frame) => Object.assign({}, frame)), | ||
}; | ||
@@ -92,3 +92,3 @@ }, | ||
const isInsidePlural = !!state.stack.find( | ||
frame => | ||
(frame) => | ||
frame.type === 'argument' && | ||
@@ -123,3 +123,3 @@ frame.formatType && | ||
indentation: stream.indentation() + indentUnit, | ||
argPos: 0 | ||
argPos: 0, | ||
}); | ||
@@ -215,3 +215,3 @@ return 'bracket'; | ||
return current.indentation; | ||
} | ||
}, | ||
}; | ||
@@ -218,0 +218,0 @@ }; |
20786
0.17%