]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve treesit-query-capture
authorYuan Fu <casouri@gmail.com>
Wed, 21 Sep 2022 01:10:01 +0000 (18:10 -0700)
committerYuan Fu <casouri@gmail.com>
Wed, 21 Sep 2022 01:36:52 +0000 (18:36 -0700)
* src/treesit.c (Ftreesit_query_capture): Add a suggestion in the
signal message.

src/treesit.c

index 775f823fb3e180e46228969b4654116a0e2771a7..eb323e6360cf1034d49e67f1783697e414d6f4d4 100644 (file)
@@ -1727,10 +1727,11 @@ query.  */)
                                  &error_offset, &error_type);
       if (lisp_query == NULL)
        {
-         xsignal2 (Qtreesit_query_error,
+         xsignal3 (Qtreesit_query_error,
                    build_string
                    (ts_query_error_to_string (error_type)),
-                   make_fixnum (error_offset + 1));
+                   make_fixnum (error_offset + 1),
+                   build_pure_c_string("Debug the query with `treesit-query-validate'"));
        }
       /* We don't need need to free TS_QUERY and CURSOR, they are stored
         in a lisp object, which is tracked by gc.  */