News for hackers. Stuff that matters.
Re:How to Get Started with Tree-Sitter by alwaysbeconsing on Monday May 29, 2023 @12:16PM (#36115332)
Point taken about the developer documentation. But the query language is only user-facing if the tool you're using exposes it. And the CLI only if you need to build your own grammars; I expect that to be less and less common as time goes on.
Re:How to Get Started with Tree-Sitter by nerdponx on Monday May 29, 2023 @03:17PM (#36117016)
Maybe this is a "blind spot" of sorts to the developers of Tree Sitter, but I find that the CLI is directly useful for end users to perform queries on their code. Maybe it would be better if we had dedicated tools that were more oriented at end users rather than developers of TS grammars, but it seems silly not to use a perfectly good tool that already exists.

Somewhat of an aside about building grammars, I have found that the grammars are relatively hard to make small modifications or extensions to. Whereas it's relatively easy with e.g. traditional Vim syntax highlighting. Making grammars easier to extend would be valuable for users of languages like SQL that have a zillion custom dialects.

Re:How to Get Started with Tree-Sitter by alwaysbeconsing on Monday May 29, 2023 @08:13PM (#36119670)
> I find that the CLI is directly useful for end users to perform queries on their code

That's interesting; what do they use the results for?

> I have found that the grammars are relatively hard to make small modifications or extensions to

Definitely true. I think this may be an inherent problem of the system and the parser generation, though. I am not sure it's solvable by the grammar authors.

Re:How to Get Started with Tree-Sitter by nerdponx on Tuesday May 30, 2023 @03:51PM (#36129721)
I use it for code search. I can search for the definition of a given function, or all places that a particular function is called by name.