]> git.eshelyaron.com Git - emacs.git/commitdiff
Add missing OFFSET arg to treesit--update-ranges-local (bug#77848)
authorYuan Fu <casouri@gmail.com>
Thu, 17 Apr 2025 23:42:07 +0000 (16:42 -0700)
committerEshel Yaron <me@eshelyaron.com>
Fri, 18 Apr 2025 06:47:20 +0000 (08:47 +0200)
* lisp/treesit.el (treesit--update-ranges-local):
(treesit--update-range-1): Add missing OFFSET arg.

(cherry picked from commit 4f80a116f53c2d8dc58301630f6dc7de6e0e346e)

lisp/treesit.el

index ec4ddce5ae96513ccdaf32956d266a3e04d94279..5311cbffef59d21d87bc3fc3706688bc87be3870 100644 (file)
@@ -1052,7 +1052,7 @@ Return updated parsers as a list."
 
 (defun treesit--update-ranges-local
     ( host-parser query embedded-lang modified-tick embed-level
-      &optional beg end range-fn)
+      &optional beg end offset range-fn)
   "Update range for local parsers between BEG and END under HOST-PARSER.
 Use QUERY to get the ranges, and make sure each range has a local
 parser for EMBEDDED-LANG.  HOST-PARSER and QUERY must match.
@@ -1082,10 +1082,10 @@ Return the created local parsers as a list."
   (let ((ranges-by-lang
          (if (functionp embedded-lang)
              (treesit-query-range-by-language
-              host-parser query embedded-lang beg end range-fn)
+              host-parser query embedded-lang beg end offset range-fn)
            (list (cons embedded-lang
                        (treesit-query-range
-                        host-parser query beg end range-fn)))))
+                        host-parser query beg end offset range-fn)))))
         (touched-parsers nil))
     (dolist (lang-and-range ranges-by-lang)
       (let ((embedded-lang (car lang-and-range))
@@ -1163,7 +1163,7 @@ Function range settings in SETTINGS are ignored."
                   (append touched-parsers
                           (treesit--update-ranges-local
                            host-parser query embed-lang modified-tick
-                           embed-level beg end range-fn))))
+                           embed-level beg end offset range-fn))))
            ;; When updating ranges, we want to avoid querying the whole
            ;; buffer which could be slow in very large buffers.
            ;; Instead, we only query for nodes that intersect with the