vscode

Quiet in here? Check #calva-dev out :smiley:
2020-01-25T09:44:48.017400Z

@pez in an attempt to understand better, i've done some simplifying of bracket pair colorizer 2 (delete portions of code, compile, execute to test whether basic functionality works). i also compared v1 to v2.

2020-01-25T09:45:36.018300Z

current impression regarding:

v2 Uses the same bracket parsing engine as VSCode, greatly increasing speed and accuracy
is that v1 uses prismjs, whereas v2 uses textmate grammar parsing.

2020-01-25T09:48:05.019300Z

v1 also appears to have been using a timer-based approach (which iiuc is what clojure warrior's approach is), and v2 doesn't appear to be

pez 2020-01-25T10:18:41.021800Z

Interesting choice. The VS Code team is planning on dropping tmGrammar in favor of whatever they are using in VS. And Atom is going with Tree Sitter.

pez 2020-01-25T10:21:00.024Z

My experience with tmGrammar (which is a third parser involved in Calva) hasn't been one of all joy and fun. I failed at implementing the comment and ignore forms highlighting there, which is why I did it in Clojure Warrior instead.

2020-01-25T12:35:49.034700Z

thanks for sharing. may be you've seen these already, but fwiw, there's: https://github.com/oakmac/tree-sitter-clojure https://github.com/Tavistock/tree-sitter-clojure i see there's a tree sitter extension for vscode and the following thread suggests there are folks interested in that approach: https://github.com/microsoft/vscode/issues/50140 i guess even if the vscode team folks go with their own thing, it's possible that a tree sitter based thing could turn out to be performant enough. may be one of the tree-sitter-clojure efforts could be adapted for use with the vscode extension...or perhaps someone has tried already?

pez 2020-01-25T12:40:44.035600Z

I wasn't aweare of the Clojure grammar for tree sitter. Very interesting! Even if they both look a bit abandoned.

pez 2020-01-25T12:41:19.036400Z

It was in that 50140 I saw that the vscode team is not planning to use tree sitter: https://github.com/microsoft/vscode/issues/50140#issuecomment-426084826

pez 2020-01-25T12:41:58.037400Z

But maybe that will be reconsidered now that they own Github...

pez 2020-01-25T12:45:20.038200Z

Also had no idea about that extension.

pez 2020-01-25T12:49:18.040700Z

For Calva I think the relevant question would be if Tree Sitter would perform better than our own parser does. The structured edit parser, that is. No idea how much work it would be to switch, but can't imagine it would be all that dramatic.

2020-01-25T13:03:28.043200Z

ah, so it was in that thread. thanks for clarifying. found another tree sitter using vscode extension: https://github.com/EvgeniyPeshkov/syntax-highlighter i guess some experimentation might be in order :)