[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tree-sitter api
From: |
Eli Zaretskii |
Subject: |
Re: Tree-sitter api |
Date: |
Wed, 15 Sep 2021 19:02:09 +0300 |
> From: Yuan Fu <casouri@gmail.com>
> Date: Wed, 15 Sep 2021 08:56:18 -0700
> Cc: Tuấn-Anh Nguyễn <ubolonton@gmail.com>,
> Theodor Thornhill <theo@thornhill.no>,
> Clément Pit-Claudel <cpitclaudel@gmail.com>,
> Emacs developers <emacs-devel@gnu.org>,
> Stefan Monnier <monnier@iro.umontreal.ca>,
> stephen_leake@stephe-leake.org
>
> > I don't understand what you are saying here. Why would major mode
> > programmers need to know the correct <lang> name? The TS facilities
> > we will have in Emacs will be language-agnostic, right? For example,
> > to correctly indent a line of code, the major mode will call some
> > hypothetical tree-sitter-get-indentation function, and that function
> > will work in any major mode, provided that the major mode told TS to
> > load the support for the programming language of the buffer. Right?
>
> Now I see why there is confusion. Tree-sitter only provide a “primitive”
> feature: the concert syntax tree, and it is not language-agnostic. You don’t
> get indentation for free, unfortunately.
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?
- Re: Tree-sitter api, (continued)
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/13
- Re: Tree-sitter api, Yuan Fu, 2021/09/13
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/13
- Re: Tree-sitter api, Yuan Fu, 2021/09/13
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/13
- Re: Tree-sitter api, Yuan Fu, 2021/09/14
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/14
- Re: Tree-sitter api, Yuan Fu, 2021/09/14
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/15
- Re: Tree-sitter api, Yuan Fu, 2021/09/15
- Re: Tree-sitter api,
Eli Zaretskii <=
- Re: Tree-sitter api, Stefan Monnier, 2021/09/15
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/15
- Re: Tree-sitter api, Yuan Fu, 2021/09/16
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/17
- Re: Tree-sitter api, Yuan Fu, 2021/09/17
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/17
- Re: Tree-sitter api, Yuan Fu, 2021/09/17
- Re: Tree-sitter api, Tuấn-Anh Nguyễn, 2021/09/17
- Re: Tree-sitter api, Yuan Fu, 2021/09/18
- Re: Tree-sitter api, Stephen Leake, 2021/09/18