-
-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V3 Treesitter Engine #1020
base: main
Are you sure you want to change the base?
V3 Treesitter Engine #1020
Conversation
Hi! Just saw your PR and was wondering when this will be merged because I'm implementing a LaTeX concealer inside Neorg and with the new Neorg parser it seems that it should be simpler to query injected LaTeX nodes, am I right? Because right now I need to create a new parser for each inline_math and fetch all the nodes so that I can conceal them |
To merge this PR, we have to complete the v3 parser first, and to do that, we should make a new spec because v1 spec currently has several issues to discuss. |
I just want to make sure that you're aware of Assuming that you know about that and you want to conceal like |
Thanks for your comment, I'm already aware of that. As a newbie of the matter I dig through the whole codebase. But to achieve what I need to do (which is exactly what you said, concealing each command with the actual symbol) I also need to parse the Latex inside the inline_math node, am I right? Only then I can effectively substitute each command node's text with the symbol |
yes I think. But for that it doesn't matter which neorg parser is used I guess |
As someone suggested in the Discord, since the V2 parser never really existed and was just a failed experiment, wouldn't it make sense to call this the V2 parser to make it match the version of the specification? |
Would've been cooler if it were called the V8 engine but it's supposed to be the 3rd version of the parser so I can't just do that :p
It's finally here! The parser is so close to completion that I can already start migrating all of Neorg to the new engine. It's fast, it's much more reliable and it's 7.7x smaller than the previous iteration(s). And if it ever breaks, then it's simple to debug and actually consistent in when it errors in my experience. V1 would work for 90% of cases and then break super randomly in irreproducible environments.
Thanks to this we can also use treesitter as a source of truth for pandoc parsers or highlighting engines (looking at you, github) 👀
EDIT: It also now compiles natively on MacOS! Wohoo!!!
TODOs
There's a lot to do for this PR alone, and there's still some preliminary stuff. Here's the checklist: