emacs-devel
[Top][All Lists]
Advanced

[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 21:48:12 +0300

> From: Yuan Fu <casouri@gmail.com>
> Date: Sat, 7 May 2022 11:27:11 -0700
> Cc: emacs-devel@gnu.org
> 
> > Would you please suggest how to "play with it"?  What features to turn
> > on and how, what commands and displays to try, etc.  Posting such
> > instructions should allow all of us get to testing this branch much
> > sooner and easier.
> 
> Some suggestions on top of my head:
> 
> - Load the attached treesit-demo.el which contains a very basic C major mode, 
> ts-c-mode, that gives you some font-locking and indentation using tree-sitter 
> features.
> - Get a C file, change its extension to .tsc, and open it
> - The major mode should be ts-c-mode, and it should have some basic 
> fontification.
> - Type M-x treesit-show-buffer-tree RET to see the AST of the C file, 
> probably want to use this on a smaller C file.
> - Type M-x treesit-inspect-mode RET to display the AST of the node at point 
> in the mode-line, see more explanation in its doctoring.
> - Set treesit--indent-verbose to t, and try to indent some lines, and see 
> which indentation rule is matched.
> 
> Is this the sort of things you are looking for?

Yes, thanks.

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.



reply via email to

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