emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Plug treesit.el into other emacs constructs


From: Stephen Leake
Subject: Re: Plug treesit.el into other emacs constructs
Date: Wed, 14 Dec 2022 15:32:15 -0800
User-agent: Gnus/5.13 (Gnus v5.13)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Cool, thanks, a few comments (based on my experience with adding
> similar things based on `smie`):
>
>> ** Forward-sexp:
>> Executing C-M-f repeatedly will go from:
>> ```
>> public void foo(|String bar, String baz) {}
>> ```
>> to
>> ```
>> public void foo(String bar|, String baz) {}
>> ```
>
> That looks wrong.  `String` is a valid AST node.  Whether it gets a node
> in tree-sitter or not, I don't know, but here there are several "sexps"
> that start at point and I think `forward-sexp` should be conservative
> and keep advancing by the smallest option.

ada-mode has something similar; forward-sexp goes to the next labeled
keyword. That's more useful than stopping at every little AST node. It
relies on markup in the grammar to label the keywords; tree-sitter would
need another markup similar to the current indent markup.

-- 
-- Stephe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]