Hacker News new | ask | show | jobs
by b3morales 1631 days ago
Are you using the official tree-sitter grammars as-is? Or tweaking/writing your own to support your use case? From what I've seen not all of them are suited to structural editing, since the emphasis is on syntax highlighting.
1 comments

Yeah using them as is and haven't had any issues so far. I think they are at a slightly lower level of abstraction than an AST, e.g. an async method in JS is a method_definition with an "async" node followed by a property_identifier, whereas an AST might wrap all this into an AsyncMethod node - but all the info you need is there.