Closed michaelalandawson closed 3 years ago
Thanks! This should be fixed in the latest version(s). (Once Package Control picks them up.)
Thank you!
@jcberquist
Package Control hasn't yet picked up the changes yet, so I can't confirm this issue after your fix, but here are a few more test cases for this issue.
Depending on the existence of the parentheses around the function arguments, the comparison operators in the return statements are displayed differently. Some comparison operators are ligatures, some are not. One is both (third example).
<cfscript>
photos = photos.filter(row => {
return a == 1;
});
photos = photos.filter((row) => {
return a == 1;
});
photos = photos.filter(row => {
return a === 1;
});
photos = photos.filter((row) => {
return a === 1;
});
photos = photos.filter(row => {
return a != 1;
});
photos = photos.filter((row) => {
return a != 1;
});
</cfscript>
Thanks! mike
Another bit of info. It appears the issue only affects the first comparison operator it finds. Subsequent operators display correctly and even fix the ligatures in the return statements.
<cfscript>
photos = photos.filter(row => {
if (a == 1){}
if (a == 1){}
return a == 1;
});
photos = photos.filter((row) => {
if (a == 1){}
if (a == 1){}
return a == 1;
});
</cfscript>
Just confirmed 0.30.2 fixed all these issues.
Thanks! mike
I noticed ligatures were not being displayed for my arrow functions in a cfscript block. I found that the difference is caused by the optional parentheses around a single function argument.
When an arrow function has a single argument, the argument does not have to be enclosed in parentheses. Multiple arguments MUST be wrapped in parentheses.
In the example below, the
.filter()
function does not wraprow
in parentheses. The=>
ligature is not displayed.The
.map()
function wrapsrow
in parentheses. The=>
ligature is displayed as expected.Here are the scopes for each example: