Hacker News new | ask | show | jobs
by McBeige 883 days ago
Ive been wanting a syntax-tree-viewer for months, to help me learn functional languages where figuring out what is even going on syntax-wise in the exmaples provided by tutorials keeps being an issue for me. Does anyone know of a way to see a syntax tree for any given snippet of code for any given language? I'd try Zed, but I'll have to wait for Linux support.
1 comments

I am not sure what debug syntax tree mode does in Zed, but if it's about tree-sitter generated syntax tree, you can see that in Neovim or Emacs (assuming you have major-mode/grammar loaded):

1) In Neovim, do `:TSPlaygroundToggle`

2) In Emacs, do `M-x treesit-explore-mode`