emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree-sitter api (Was: Re: How to add pseudo vector types)


From: Eli Zaretskii
Subject: Re: Tree-sitter api (Was: Re: How to add pseudo vector types)
Date: Sat, 07 Aug 2021 09:26:30 +0300

> From: Fu Yuan <casouri@gmail.com>
> Date: Sat, 7 Aug 2021 00:31:36 -0500
> Cc: cpitclaudel@gmail.com, stephen_leake@stephe-leake.org,
>  monnier@iro.umontreal.ca, emacs-devel@gnu.org
> 
> > We should probably start thinking how to integrate TS-related
> > functionalities into Emacs in general.  E.g., should there be an
> > option to activate it? should this option be per major mode? something
> > else?
> 
> We should have a user option to control tree-sitter on major mode level. 
> Maybe an alist where each car is a major node symbol and each cdr is a 
> Boolean value toggling tree-sitter for that node.
> 
> We also need tree-sitter-maximum-buffer-size, so that buffer larger than this 
> size won’t enable tree-sitter. (And we need to make sure we never use 
> tree-sitter on buffers larger than 4GB because tree-sitter uses unint32.)
> 
> And we can provide a function free-sitter-should-activate-p that computes if 
> we should enable tree-sitter in the current buffer by variables mentioned 
> above, that can be used by major-modes when setting up.
> 
> I’m also thinking about having a tree-sitter-defaults that’s analogous to 
> font-lock-defaults, that is set by each major node and used to generate 
> tree-sitter-font-lock-settings.
> 
> As for indentation, we could provide some infrastructure like we do for 
> font-locking, or we can just let major modes implement their indent function 
> with tree-sitter api.

SGTM, thanks.



reply via email to

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