drym-org / symex.el

An intuitive way to edit Lisp symbolic expressions ("symexes") structurally in Emacs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tree-sitter: Make movements consistent with Lisp

countvajhula opened this issue · comments

In the tree sitter node navigation commands, "named" visits too few nodes, while "all of them" visits too many. I'd say we're looking for the behavior that "all" has, except that it shouldn't visit punctuation like , and closing delimiters like ].

(a) Does tree-sitter provide some metadata on the node that we could use to tell that it's "empty", e.g. punctuation or a closing delimiter? If it does, then we could use the "all" behavior while avoiding such "empty" nodes.

(b) Another (less desirable) possibility is to have an exclusion list that skips over these at the symex level.

(c) A third possibility is to do nothing and leave it as "named" nodes, especially if we agree it would be preferable to option (b) above (e.g. would (b) require maintaining separate exclusion lists for different languages?).

Additional context: see this comment and the responses.