I can't seem to figure out a way to surface parser errors to the user of my text editor. In particular, I'm working on a VSCode extension using tree-sitter to parse typescript files and surface parsing errors. Tree-sitter is much faster than the typescript language service, so far, but I can't seem to figure out how to surface a useful error message to the user.
In particular, I'd like something like the Parsing error: ';' expected. that eslint gives me. I figure that tree-sitter has some sort of context on the active branches in the parser, so should be able to surface that context in the error object.
If this feature already exists, and I'm just missing something, perhaps it should be included in the documentation site, as I couldn't find anything there.