From a4d7bcccba5ffaafb769d8f517c159d64b0887bc Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Wed, 15 Jun 2022 12:15:24 -0700 Subject: [PATCH] ; * src/treesit.c: Add comment to explain design decisions. --- src/treesit.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/treesit.c b/src/treesit.c index 8d0f2e517af..88d5ea91223 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -89,6 +89,14 @@ along with GNU Emacs. If not, see . */ - lisp/emacs-lisp/cl-preloaded.el & data.c & lisp.h for parser and node type. + We don't parse at every keystroke. Instead we only record the + changes at each keystroke, and only parse when requested. It is + possible that lazy parsing is worse: instead of dispersed little + pauses, now you have less frequent but larger pauses. I doubt + there will be any perceived difference, as the lazy parsing is + going to be pretty frequent anyway. Also this (lazy parsing) is + what the mailing list guys wanted. + Because it is pretty slow (comparing to other tree-sitter operations) for tree-sitter to parse the query and produce a query object, it is very wasteful to reparse the query every time -- 2.39.5