3 ms·
> Zas Editor reparses your code on every keystroke without compromising performance. Having a maintained AST at all times brings many intelligent features to th
by twic 5y ago
> Zas Editor reparses your code on every keystroke without compromising performance. Having a maintained AST at all times brings many intelligent features to the editor.
How does this work in the presence of syntax errors? 95% of the time you're writing code, your code is syntactically invalid, because you've started some new construct but not finished it yet, so you need syntax highlighting, code completion, etc to work sensibly in that situation. Getting that wrong is what killed RLS, IIRC.
- iovrthoughtthis 5y agoyou still have the previously valid tree because the parsing is incremental i suspect it's tree sitter under the hood
- twic 5y agoBold of you to assume that the previous state of my code was valid!
- ris58h 5y agoThey use tree-sitter https://tree-sitter.github.io/tree-sitter/ https://tree-sitter.github.io/tree-sitter/ It's ok with errors in AST and just marks such nodes as invalid. There is a long (42 minutes) but worth to watch talk about tree-sitter https://www.youtube.com/watch?v=a1rC79DHpmY https://www.youtube.com/watch?v=a1rC79DHpmY Or the shorter version (20 minutes) https://www.youtube.com/watch?v=0CGzC_iss-8 https://www.youtube.com/watch?v=0CGzC_iss-8