aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorJuanma Barranquero2022-11-22 04:40:49 +0100
committerJuanma Barranquero2022-11-22 04:40:49 +0100
commitea73fd69f0c6251ad9b8fc8267ce0fa68495715e (patch)
treee0631740c8aef46d68080214f6bbf2900fa8a996 /admin
parent19954da8dd927f9db4ca95d8a1320207e6c404cd (diff)
downloademacs-ea73fd69f0c6251ad9b8fc8267ce0fa68495715e.tar.gz
emacs-ea73fd69f0c6251ad9b8fc8267ce0fa68495715e.zip
; Fix typos in tree-sitter files
* admin/notes/tree-sitter/starter-guide (Font-lock) (Debugging queries, Indent, Navigation, Which-func) (More features?): * lisp/treesit.el (treesit--merge-ranges) (treesit-font-lock-feature-list, treesit-font-lock-rules) (treesit-font-lock-fontify-region, treesit--font-lock-notifier) (treesit-simple-indent-presets, treesit--font-lock-fast-mode) (treesit--indent-region-batch-size) (treesit--indent-rules-optimize, treesit-ready-p): Fix typos.
Diffstat (limited to 'admin')
-rw-r--r--admin/notes/tree-sitter/starter-guide18
1 files changed, 9 insertions, 9 deletions
diff --git a/admin/notes/tree-sitter/starter-guide b/admin/notes/tree-sitter/starter-guide
index faf40bc64fe..123dabd9f29 100644
--- a/admin/notes/tree-sitter/starter-guide
+++ b/admin/notes/tree-sitter/starter-guide
@@ -111,7 +111,7 @@ will be fontified in their capture name.
111 111
112The capture name could also be a function, in which case (NODE 112The capture name could also be a function, in which case (NODE
113OVERRIDE START END) is passed to the function for fontification. START 113OVERRIDE START END) is passed to the function for fontification. START
114and END is the start and end of the region to be fontified. The 114and END are the start and end of the region to be fontified. The
115function should only fontify within that region. The function should 115function should only fontify within that region. The function should
116also allow more optional arguments with (&rest _), for future 116also allow more optional arguments with (&rest _), for future
117extensibility. For OVERRIDE check out the docstring of 117extensibility. For OVERRIDE check out the docstring of
@@ -169,7 +169,7 @@ Neovim also has a bunch of queries to reference:
169The manual explains how to read grammar files in the bottom of section 169The manual explains how to read grammar files in the bottom of section
170"Tree-sitter Language Definitions". 170"Tree-sitter Language Definitions".
171 171
172** Debugging queires 172** Debugging queries
173 173
174If your query has problems, use ‘treesit-query-validate’ to debug the 174If your query has problems, use ‘treesit-query-validate’ to debug the
175query. It will pop a buffer containing the query (in text format) and 175query. It will pop a buffer containing the query (in text format) and
@@ -261,8 +261,8 @@ Indent works like this: We have a bunch of rules that look like
261When the indentation process starts, point is at the BOL of a line, we 261When the indentation process starts, point is at the BOL of a line, we
262want to know which column to indent this line to. Let NODE be the node 262want to know which column to indent this line to. Let NODE be the node
263at point, we pass this node to the MATCHER of each rule, one of them 263at point, we pass this node to the MATCHER of each rule, one of them
264will match the node (eg, "this node is a closing bracket!"). Then we pass 264will match the node (eg, "this node is a closing bracket!"). Then we
265the node to the ANCHOR, which returns a point, eg, the BOL of the 265pass the node to the ANCHOR, which returns a point, eg, the BOL of the
266previous line. We find the column number of that point (eg, 4), add 266previous line. We find the column number of that point (eg, 4), add
267OFFSET to it (eg, 0), and that is the column we want to indent the 267OFFSET to it (eg, 0), and that is the column we want to indent the
268current line to (4 + 0 = 4). 268current line to (4 + 0 = 4).
@@ -297,7 +297,7 @@ There is also a manual section for indent: "Parser-based Indentation".
297 297
298When writing indent rules, you can use ‘treesit-check-indent’ to 298When writing indent rules, you can use ‘treesit-check-indent’ to
299check if your indentation is correct. To debug what went wrong, set 299check if your indentation is correct. To debug what went wrong, set
300‘treesit--indent-verboase’ to non-nil. Then when you indent, Emacs 300‘treesit--indent-verbose’ to non-nil. Then when you indent, Emacs
301tells you which rule is applied in the echo area. 301tells you which rule is applied in the echo area.
302 302
303#+begin_src elisp 303#+begin_src elisp
@@ -358,7 +358,7 @@ definition node, and ’end means we want to go to the end of that node.
358 358
359Tree-sitter has default implementations for 359Tree-sitter has default implementations for
360‘beginning-of-defun-function’ and ‘end-of-defun-function’. So for 360‘beginning-of-defun-function’ and ‘end-of-defun-function’. So for
361ordinary languages, it is suffice to set ‘treesit-defun-type-regexp’ 361ordinary languages, it is enough to set ‘treesit-defun-type-regexp’
362to something that matches all the defun struct types in the language, 362to something that matches all the defun struct types in the language,
363and call ‘treesit-major-mode-setup’. For example, 363and call ‘treesit-major-mode-setup’. For example,
364 364
@@ -375,8 +375,8 @@ and call ‘treesit-major-mode-setup’. For example,
375If you have an imenu implementation, set ‘which-func-functions’ to 375If you have an imenu implementation, set ‘which-func-functions’ to
376nil, and which-func will automatically use imenu’s data. 376nil, and which-func will automatically use imenu’s data.
377 377
378If you want independent implementation for which-func, you can find 378If you want an independent implementation for which-func, you can
379the current function by going up the tree and looking for the 379find the current function by going up the tree and looking for the
380function_definition node. See the function below for an example. 380function_definition node. See the function below for an example.
381Since Python allows nested function definitions, that function keeps 381Since Python allows nested function definitions, that function keeps
382going until it reaches the root node, and records all the function 382going until it reaches the root node, and records all the function
@@ -410,7 +410,7 @@ For INCLUDE-TYPE see `python-info-current-defun'."
410* More features? 410* More features?
411 411
412Obviously this list is just a starting point, if there are features in 412Obviously this list is just a starting point, if there are features in
413the major mode that would benefit a parse tree, adding tree-sitter 413the major mode that would benefit from a parse tree, adding tree-sitter
414support for that would be great. But in the minimal case, just adding 414support for that would be great. But in the minimal case, just adding
415font-lock is awesome. 415font-lock is awesome.
416 416