3 ms·
I mean, it depends on how much code it has to lex/parse, but yes, it's pretty fast but not realtime. That is usually the goal for editors, or at least, what is
by DannyBee 3y ago
I mean, it depends on how much code it has to lex/parse, but yes, it's pretty fast but not realtime.
That is usually the goal for editors, or at least, what is tried to achieve.
It can't be done every keystroke, it can't be done close to every keystroke. For clangd it's dependent on the size of includes/etc, though it does a reasonable job of caching :)
But it's not hard to out-type it.
"That being said, I believe that most editors do a hybrid approach to lexing/parsing because getting syntax information entirely from clangd is too much to ask. So basically the editor will do a best-effort parse in real time of your code using some built-in syntax highlighting engine (possibly tree-sitter, possibly something else) and then once clangd sends syntax information they'll update the document as necessary."
Which is precisely what i said most of them should do.
It's just that starting with "textmate" basically makes no sense when things like tree-sitter are available.