emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree-sitter api


From: Yoav Marco
Subject: Re: Tree-sitter api
Date: Fri, 24 Dec 2021 12:21:16 +0200
User-agent: mu4e 1.6.3; emacs 28.0.60


> Yuan Fu <notifications@github.com> writes:
>> I can see some advantages to compile the query ahead of time. 1) It would be
>> helpful to know there is an error before calling
>> tree-sitter-font-lock-fontify-region and see an unfontified buffer, not
>> knowing what went wrong. I can add a function, say, tree-sitter-compile-query
>> that checks a query (as in query pattern) and passes it on if its correct. 2)
>> It could potentially saves recompilation of the query. But computing the 
>> query
>> most probably takes negligible time.

I'll try to benchmark it. Would be great if it really is nothing.

>> On the other hand, compiling the query has downsides: I don't know what does
>> tsc-make-query return, I assume an internal object? I try to minimize the
>> number of new object types I introduce to Emacs, for hygiene. So far I've
>> managed to add only parser object and node object. If there aren't good
>> reasons I'm inclined to not add a query object. So far the advantages that I
>> see aren't very convincing.

Yeah, it returns a user-pointer.



reply via email to

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