Closed dane-johnson closed 7 years ago
Because grammars can't read ahead i have no idea this is an arrow function at the point of entry. For certain comma delimited arrow functions I make a 'probable guess' that it is an arrow function coming up but I've already parsed the name of the variable before I make this determination. So in your example above the arguments are scoped as function parameters but the variable holding the function is denoted as a storage var.
I will have a look to see if anything can be done to improve this but I'm not sure it is possible without undesirable side effects.
I noticed a similar bug in the Coffeescript grammar as well
Just to be cheeky I made an issue there too. https://github.com/atom/language-coffee-script/issues/125
I can't fix this due to limitations beyond my control so i'll close this issue.
@gandm This issue comes up from time to time — perhaps we should add a "sticky" issue for this and flag it as "upstream bug"?
An arrow function definition that has newlines in the arguments list is not identified as a function in the syntax highlight.