~This PR is branched off of #154 and will look like a mess until rebased.~ rebased!
~The code is definitely WIP. It works, and works better than what we had, and requires less code.~
~Still, I'd like to recast it in terms of pygn-mode--true-containing-node and tsc-get-next-sibling. Looking for the face with text-property-search-forward is a cheat.~
cc @qnix with tree-sitter's full parse, we will no longer require those glitchy regular expressions for navigation.
~Edit: I turned off testing against Emacs 26.3 just to make tests pass for the moment. Turns out text-property-search-forward was not available.~
Edit: This function is now implemented the "right way" in terms of pygn-mode--true-containing-node and tsc-get-next-sibling, and does not use text-property-search-forward. It also now should be straightforward to adapt this logic to pygn-mode-previous-move using the same principles.
One subtlety was that tree-sitter-node-at-point was sometimes needed instead of pygn-mode--true-containing-node, which is explained in a comment.
There may be ways to make the function slightly less verbose in a later refactor.
~This PR is branched off of #154 and will look like a mess until rebased.~ rebased!
~The code is definitely WIP. It works, and works better than what we had, and requires less code.~
~Still, I'd like to recast it in terms of
pygn-mode--true-containing-node
andtsc-get-next-sibling
. Looking for the face withtext-property-search-forward
is a cheat.~cc @qnix with tree-sitter's full parse, we will no longer require those glitchy regular expressions for navigation.
~Edit: I turned off testing against Emacs 26.3 just to make tests pass for the moment. Turns out
text-property-search-forward
was not available.~Edit: This function is now implemented the "right way" in terms of
pygn-mode--true-containing-node
andtsc-get-next-sibling
, and does not usetext-property-search-forward
. It also now should be straightforward to adapt this logic topygn-mode-previous-move
using the same principles.One subtlety was that
tree-sitter-node-at-point
was sometimes needed instead ofpygn-mode--true-containing-node
, which is explained in a comment.There may be ways to make the function slightly less verbose in a later refactor.