> The tree-sitter-enabled function, `treesit-transpose-sexps', > that is called by transpose-sexps, is broken. After many unsuccessful attempts I finally arrived at the usable implementation. For example, typing 'C-M-t' between two conditions: if (x > 72 && -!-y < 85) { // found do_something(); } swaps these two conditions: if (y < 85 && x > 72) { // found do_something(); } whereas inside the binary expression if (x > -!-72 && y < 85) { // found do_something(); } it swaps its components: if (72 > x && y < 85) { // found do_something(); } Or with point between two objects in an array: var a = [{ case: 'zzzz', default: 'yyyy' }, -!-{ case: 'zzzz2', default: 'yyyy' }]; it swaps these objects: var a = [{ case: 'zzzz2', default: 'yyyy' }, { case: 'zzzz', default: 'yyyy' }]; whereas with point between two pairs var a = [{ case: 'zzzz', -!-default: 'yyyy' }]; it swaps these pairs var a = [{ default: 'yyyy', case: 'zzzz' }]; while keeping the right punctuation. In a string it falls back to the default function.