[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tree-sitter integration on feature/tree-sitter
From: |
Eli Zaretskii |
Subject: |
Re: Tree-sitter integration on feature/tree-sitter |
Date: |
Sat, 07 May 2022 22:25:42 +0300 |
> From: Yuan Fu <casouri@gmail.com>
> Date: Sat, 7 May 2022 12:11:06 -0700
> Cc: emacs-devel@gnu.org
>
> > However, I hoped that the font-lock and indentation are already
> > integrated with tree-sitter, and all that is needed for a given
> > major-mode to use it is to flip some variable. I didn't expect to
> > need a completely separate major mode for C sources, for example.
> >
> > It sounds like we are farther from the goal that I thought we were,
> > and some serious work is still ahead of us to get this integrated into
> > the existing major modes.
>
> I used a separate major mode because I don’t want to touch the existing one,
> and this is only a simple demo. For the author of a major-mode, they only
> need to port their font-lock-defaults and indent function to use tree-sitter
> features. If you look at the definition of ts-c-mode, its roughly
But eventually, we will touch the major modes, because the goal,
AFAIU, is to have tree-sitter-supported features be part of the major
modes Emacs provides,l perhaps first as an opt-in feature, but
eventually I hope as the default behavior.
> > However, I hoped that the font-lock and indentation are already
> > integrated with tree-sitter, and all that is needed for a given
> > major-mode to use it is to flip some variable.
>
> That’s too much magic to ask from tree-sitter.
I didn't expect tree-sitter to do this for us, I thought the code
which integrates it into Emacs should do it, and hoped that code was
already written.
Don't be mistaken: that I thought the situation was different is
entirely my fault, not yours. Thank you for the work you have done
that brought us where we are today.
- Re: Tree-sitter integration on feature/tree-sitter, (continued)
- Re: Tree-sitter integration on feature/tree-sitter, Eli Zaretskii, 2022/05/07
- Re: Tree-sitter integration on feature/tree-sitter, Yuan Fu, 2022/05/07
- Re: Tree-sitter integration on feature/tree-sitter, Yuan Fu, 2022/05/07
- Re: Tree-sitter integration on feature/tree-sitter,
Eli Zaretskii <=
- Re: Tree-sitter integration on feature/tree-sitter, Yuan Fu, 2022/05/07
- Re: Tree-sitter integration on feature/tree-sitter, Theodor Thornhill, 2022/05/07
- Re: Tree-sitter integration on feature/tree-sitter, Stefan Monnier, 2022/05/07
- Re: Tree-sitter integration on feature/tree-sitter, Theodor Thornhill, 2022/05/07
- Re: Tree-sitter integration on feature/tree-sitter, Eli Zaretskii, 2022/05/08
- Re: Tree-sitter integration on feature/tree-sitter, Dmitry Gutov, 2022/05/08
- Re: Tree-sitter integration on feature/tree-sitter, Stefan Monnier, 2022/05/08
- Re: Tree-sitter integration on feature/tree-sitter, Eli Zaretskii, 2022/05/08
- Re: Tree-sitter integration on feature/tree-sitter, Dmitry Gutov, 2022/05/08
- Re: Tree-sitter integration on feature/tree-sitter, Eli Zaretskii, 2022/05/08