diff options
| author | Yuan Fu | 2022-06-15 12:15:24 -0700 |
|---|---|---|
| committer | Yuan Fu | 2022-06-16 11:52:03 -0700 |
| commit | a4d7bcccba5ffaafb769d8f517c159d64b0887bc (patch) | |
| tree | fabe403140c684829157b72dfe8458bc4c9db9cd /src | |
| parent | 0332b8e2c5f2909b108ae4b63641b38a42c27fd3 (diff) | |
| download | emacs-a4d7bcccba5ffaafb769d8f517c159d64b0887bc.tar.gz emacs-a4d7bcccba5ffaafb769d8f517c159d64b0887bc.zip | |
; * src/treesit.c: Add comment to explain design decisions.
Diffstat (limited to 'src')
| -rw-r--r-- | src/treesit.c | 8 |
1 files changed, 8 insertions, 0 deletions
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 <https://www.gnu.org/licenses/>. */ | |||
| 89 | - lisp/emacs-lisp/cl-preloaded.el & data.c & lisp.h for parser and | 89 | - lisp/emacs-lisp/cl-preloaded.el & data.c & lisp.h for parser and |
| 90 | node type. | 90 | node type. |
| 91 | 91 | ||
| 92 | We don't parse at every keystroke. Instead we only record the | ||
| 93 | changes at each keystroke, and only parse when requested. It is | ||
| 94 | possible that lazy parsing is worse: instead of dispersed little | ||
| 95 | pauses, now you have less frequent but larger pauses. I doubt | ||
| 96 | there will be any perceived difference, as the lazy parsing is | ||
| 97 | going to be pretty frequent anyway. Also this (lazy parsing) is | ||
| 98 | what the mailing list guys wanted. | ||
| 99 | |||
| 92 | Because it is pretty slow (comparing to other tree-sitter | 100 | Because it is pretty slow (comparing to other tree-sitter |
| 93 | operations) for tree-sitter to parse the query and produce a query | 101 | operations) for tree-sitter to parse the query and produce a query |
| 94 | object, it is very wasteful to reparse the query every time | 102 | object, it is very wasteful to reparse the query every time |