unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Hooks on treesit parse refresh
@ 2023-02-24  5:14 Abin Simon
  2023-02-28 12:37 ` Daniel Martín
  0 siblings, 1 reply; 2+ messages in thread
From: Abin Simon @ 2023-02-24  5:14 UTC (permalink / raw)
  To: help-gnu-emacs

I was adding support for builtin treesit to one of my packages,
scopeline.  https://github.com/meain/scopeline.el

The package makes use of these hooks in elisp-tree-sitter to run when a
tree-sitter tree refresh has happened:
- tree-sitter-after-first-parse-hook
- tree-sitter-after-change-functions

I was going through treesit code, but could not find anything
similar. `treesit-explore' seem to add a hook to `post-command-hook' but
wanted to check if there was something more specific that I could use
instead.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Hooks on treesit parse refresh
  2023-02-24  5:14 Hooks on treesit parse refresh Abin Simon
@ 2023-02-28 12:37 ` Daniel Martín
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Martín @ 2023-02-28 12:37 UTC (permalink / raw)
  To: Abin Simon; +Cc: help-gnu-emacs

Abin Simon <mail@meain.io> writes:

> I was adding support for builtin treesit to one of my packages,
> scopeline.  https://github.com/meain/scopeline.el
>
> The package makes use of these hooks in elisp-tree-sitter to run when a
> tree-sitter tree refresh has happened:
> - tree-sitter-after-first-parse-hook
> - tree-sitter-after-change-functions
>
> I was going through treesit code, but could not find anything
> similar. `treesit-explore' seem to add a hook to `post-command-hook' but
> wanted to check if there was something more specific that I could use
> instead.

The closest API in Emacs 29 is the concept of Tree-sitter notifiers.
Read the documentation of function treesit-parser-add-notifier and
friends.

If this API is not sufficient for what you are trying to implement, I
suggest you open a feature suggestion by sending an email to
bug-gnu-emacs@gnu.org

Thanks.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-28 12:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-24  5:14 Hooks on treesit parse refresh Abin Simon
2023-02-28 12:37 ` Daniel Martín

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).