Fork me on GitHub
#vscode
<
2020-02-03
>
sogaiu13:02:51

here's a screenshot of a poc vscode extension (written in cljs) for doing rainbow parens via tree sitter. (the colors for other things are not done by this extension)

pez13:02:37

That's nice!

sogaiu21:02:41

thanks - do you have any tips or resources on measuring performance?

pez21:02:51

I think parcera might have some performance testing. But I could be remembering wrongly.

pez21:02:53

Something that chokes one of Calva's parsers is long input strings. So if you get a large/deep structure back as a result from evaluation and it is not pretty printed. It starts to get painful at 10K chars. The parser for Calva's rainbow parens deals with long strings much better.

sogaiu22:02:58

thanks for the parecera hint -- may be this part? https://github.com/carocad/parcera/blob/master/test/parcera/benchmark.clj it looks like (at least the c api of) tree sitter has the ability to work with timeouts: https://github.com/tree-sitter/tree-sitter/blob/master/lib/include/tree_sitter/api.h#L289_L296 i don't see that exposed for web-tree-sitter though: https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/tree-sitter-web.d.ts