By non-rvalued expressions I mean expressions that can not be used on the right side of an assignment.
The usual example of non-rvalues on lua are assignments themselves. If you put an assignment (or any other expression without an r-value) on a callback tsc throws an error.
If for some reason (i.e. tests failing) the "return" is needed, then the opts[callback] should be encased inside a (function() ... end)() call, like so:
Thanks for submitting this. I added your suggested change; I think the return was there from an earlier stage in telescope's development and was no longer needed, so I simply removed it.
By non-rvalued expressions I mean expressions that can not be used on the right side of an assignment.
The usual example of non-rvalues on lua are assignments themselves. If you put an assignment (or any other expression without an r-value) on a callback tsc throws an error.
Example:
The conflict can be found on this line:
This line appends 'return ' to the callback string; return needs an r-valued expression on its right side, or else it fails.
The simplest fix is removing the 'return':
If for some reason (i.e. tests failing) the "return" is needed, then the opts[callback] should be encased inside a (function() ... end)() call, like so:
This should have the same behaviour as before, but allowing assignments on callbacks.
Regards!