[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Hooks on treesit parse refresh
From: |
Daniel Martín |
Subject: |
Re: Hooks on treesit parse refresh |
Date: |
Tue, 28 Feb 2023 13:37:08 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) |
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.