Closed alexpw closed 1 year ago
if (100 > foo(x, y)): x = 1
On master, toggling > produces this error:
>
E5108: Error executing lua ...ts-node-action/init.lua:49: invalid value (table) at index 3 in table for 'concat'
Before the change to helpers.node_text() it produced this error:
helpers.node_text()
E5108: Error executing lua .../ts-node-action/init.lua:15: String cannot contain newlines
This alters actions.toggle_operator() to only replace the unnamed node for >, by targeting it directly, rather than replacing the entire expression.
actions.toggle_operator()
This will now preserve the original formatting. Previously, it collapsed the expression, eg:
became:
Great, thanks :)
Issue:
On master, toggling
>
produces this error:Before the change to
helpers.node_text()
it produced this error:Implementation:
This alters
actions.toggle_operator()
to only replace the unnamed node for>
, by targeting it directly, rather than replacing the entire expression.Bonus:
This will now preserve the original formatting. Previously, it collapsed the expression, eg:
became: