From bc66ff98756fa28bbc733ef81103cac6730438fa Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Thu, 13 Oct 2022 14:39:51 -0700 Subject: [PATCH] * src/treesit.c (Ftreesit_query_language): New function. --- src/treesit.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/treesit.c b/src/treesit.c index 2b2e9c6d793..7cfcc715f9b 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -781,6 +781,16 @@ DEFUN ("treesit-query-p", return Qnil; } +DEFUN ("treesit-query-language", + Ftreesit_query_language, Streesit_query_language, 1, 1, 0, + doc: /* Return the language of QUERY. +QUERY has to be a compiled query. */) + (Lisp_Object query) +{ + CHECK_TS_COMPILED_QUERY (query); + return XTS_COMPILED_QUERY(query)->language; +} + DEFUN ("treesit-node-parser", Ftreesit_node_parser, Streesit_node_parser, 1, 1, 0, @@ -2386,6 +2396,7 @@ dynamic libraries, in that order. */); defsubr (&Streesit_node_p); defsubr (&Streesit_compiled_query_p); defsubr (&Streesit_query_p); + defsubr (&Streesit_query_language); defsubr (&Streesit_node_parser); -- 2.39.2