tree-sitter / tree-sitter

An incremental parsing system for programming tools

Home Page:https://tree-sitter.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Playground should show anonymous nodes

savetheclocktower opened this issue · comments

Problem

People ask pretty often in Discord about the concept of anonymous nodes. Since the playground doesn't show them alongside named nodes, there's not much visibility around them, and it's easy for an inexperienced Tree-sitter user to think that they just aren't there, or that they can't be queried against.

Expected behavior

We implemented the playground inside of Pulsar as part of the tree-sitter-tools package, and I solved this by making a toggle:

Screenshot 2024-04-05 at 7 23 00 PM

It could be off by default, but its presence would make it clearer that anonymous nodes aren't absent — they're just hidden from the tree by default.

I'll likely get around to contributing this myself as a PR, but maybe someone else might get to it first.