emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree-sitter api


From: Yuan Fu
Subject: Re: Tree-sitter api
Date: Thu, 16 Sep 2021 14:46:08 -0700


> On Sep 15, 2021, at 11:48 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Stefan Monnier <monnier@iro.umontreal.ca>
>> Cc: Yuan Fu <casouri@gmail.com>,  ubolonton@gmail.com,  theo@thornhill.no,
>>  cpitclaudel@gmail.com,  emacs-devel@gnu.org,
>>  stephen_leake@stephe-leake.org
>> Date: Wed, 15 Sep 2021 14:19:12 -0400
>> 
>>> I wasn't talking about tree-sitter itself, I was talking about the
>>> facilities Emacs will provide based on TS.  There will be in Emacs a
>>> function to calculate indentation using TS, right?  And that function
>>> will be language-agnostic, like indent-line-function is, right?
>> 
>> There is such a function but it doesn't do anything itself.  It relies
>> on the major-mode to do the heavy lifting which consists in giving
>> indentation rules for each one of the possible node types that can
>> appear in the AST
> 
> Sure, and the new one will do that with help of TS.  But the principle
> is the same.

My point is, major mode writers need to read the source of the tree-sitter 
language definition to do anything useful with tree-sitter, therefore they must 
know the correct <lang> name.

Yuan


reply via email to

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