Curried arrow function break formatting unless there's space after the => operator. #545
Description
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: http://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
[Description of the issue]
Steps to Reproduce
- Make a JS file w/ a curried arrow function. For example:
var a = 3;
//Hello
/* Hello */
const curriedFunction = (x)=>(y)=>{
console.log(x * y * z);
}
var b = 4;
//Hello
/* Hello*/
for (let i = 0; i < 2; ++i) {
console.log(i);
}
var c = 4;
function foo() {
console.log("broke");
}
var d = 5;
const unbreak = ()=>{
console.log("unbroke");
}
var e = 3;
- Set the language to JavaScript if not set already
Expected behavior: Normal formatting behavior. The function body is formatted as a function body, and the lines following the function body are normal, as though the function weren't there.
Actual behavior: The code following the first arrow becomes weirdly formatted. Keywords are uncolored. Numbers are given a red-background error highlighting. And so on. See this screenshot:
Versions
Atom : 1.22.1
Electron: 1.6.15
Chrome : 56.0.2924.87
Node : 7.4.0
apm 1.18.8
npm 3.10.10
node 6.9.5 ia32
python
git 2.11.0.windows.3
visual studio
Additional Information
I do have CSS styling on comments (so they're slightly yellowish instead of gray), however I was still able to reproduce this issue in safe mode and with all of my configuration in a backup folder, so it's probably unrelated.
I do have atom-ide-ui and ide-typescript, if that matters at all.
This is only my second bug report with an atom package, so if I've made any mistakes in reporting, please don't hesitate to alert me.
Thank you!