unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* New on shelf: Tree-sitter explorer
@ 2022-11-16 23:54 Yuan Fu
  2022-11-17  1:34 ` Randy Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Yuan Fu @ 2022-11-16 23:54 UTC (permalink / raw)
  To: emacs-devel

FYI I added a command treesit-explore-mode, which pops up a window showing the syntax tree of the current buffer in real time. This should be useful for folks working on tree-sitter :-)

Yuan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: New on shelf: Tree-sitter explorer
  2022-11-16 23:54 New on shelf: Tree-sitter explorer Yuan Fu
@ 2022-11-17  1:34 ` Randy Taylor
  2022-11-17  3:28   ` Yuan Fu
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Taylor @ 2022-11-17  1:34 UTC (permalink / raw)
  To: Yuan Fu; +Cc: emacs-devel

On Wednesday, November 16th, 2022 at 18:54, Yuan Fu <casouri@gmail.com> wrote:
> 
> FYI I added a command treesit-explore-mode, which pops up a window showing the syntax tree of the current buffer in real time. This should be useful for folks working on tree-sitter :-)
> 
> Yuan

Looks and works great, thanks!

I like that the explorer highlights the code that the node represents - perhaps the inverse could be implemented too? That is, in the buffer being explored (i.e. the code), when point is moved to the start of a node (or within a node), it would be highlighted in the explorer.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: New on shelf: Tree-sitter explorer
  2022-11-17  1:34 ` Randy Taylor
@ 2022-11-17  3:28   ` Yuan Fu
  2022-11-17  3:34     ` Randy Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Yuan Fu @ 2022-11-17  3:28 UTC (permalink / raw)
  To: Randy Taylor; +Cc: emacs-devel



> On Nov 16, 2022, at 5:34 PM, Randy Taylor <dev@rjt.dev> wrote:
> 
> On Wednesday, November 16th, 2022 at 18:54, Yuan Fu <casouri@gmail.com> wrote:
>> 
>> FYI I added a command treesit-explore-mode, which pops up a window showing the syntax tree of the current buffer in real time. This should be useful for folks working on tree-sitter :-)
>> 
>> Yuan
> 
> Looks and works great, thanks!
> 
> I like that the explorer highlights the code that the node represents - perhaps the inverse could be implemented too? That is, in the buffer being explored (i.e. the code), when point is moved to the start of a node (or within a node), it would be highlighted in the explorer.

Good news: if you select text in the source buffer, the enclosed nodes are highlighted in the syntax tree.

Yuan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: New on shelf: Tree-sitter explorer
  2022-11-17  3:28   ` Yuan Fu
@ 2022-11-17  3:34     ` Randy Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Taylor @ 2022-11-17  3:34 UTC (permalink / raw)
  To: Yuan Fu; +Cc: emacs-devel

On Wednesday, November 16th, 2022 at 22:28, Yuan Fu <casouri@gmail.com> wrote:

> 
> > On Nov 16, 2022, at 5:34 PM, Randy Taylor dev@rjt.dev wrote:
> > 
> > I like that the explorer highlights the code that the node represents - perhaps the inverse could be implemented too? That is, in the buffer being explored (i.e. the code), when point is moved to the start of a node (or within a node), it would be highlighted in the explorer.
> 
> 
> Good news: if you select text in the source buffer, the enclosed nodes are highlighted in the syntax tree.
> 
> Yuan

Perfect, thanks! I should've tried that ;).



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-17  3:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16 23:54 New on shelf: Tree-sitter explorer Yuan Fu
2022-11-17  1:34 ` Randy Taylor
2022-11-17  3:28   ` Yuan Fu
2022-11-17  3:34     ` Randy Taylor

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).