GNU bug report logs - #60251
29.0.60; Consider the language at point for tree sitter treesit-inspect-node-at-point

Previous Next

Package: emacs;

Reported by: Wilhelm H Kirschbaum <wilhelm <at> floatpays.co.za>

Date: Thu, 22 Dec 2022 08:57:02 UTC

Severity: normal

Found in version 29.0.60

To reply to this bug, email your comments to 60251 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#60251; Package emacs. (Thu, 22 Dec 2022 08:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Wilhelm H Kirschbaum <wilhelm <at> floatpays.co.za>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 22 Dec 2022 08:57:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Wilhelm H Kirschbaum <wilhelm <at> floatpays.co.za>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.60; Consider the language at point for tree sitter
 treesit-inspect-node-at-point
Date: Thu, 22 Dec 2022 10:42:03 +0200
The following change will make it possible to inspect a node when 
using
an embedded language, otherwise it will assume the first specified
language without allowing specifying the language. This assumes 
that
treesit-language-at-point-function has been correctly set. 

diff --git a/lisp/treesit.el b/lisp/treesit.el
index 6407669118..74dfd26776 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -1931,7 +1931,7 @@ treesit-inspect-node-at-point
  (interactive "p")
  ;; NODE-LIST contains all the node that starts at point.
  (let* ((node-list
-          (cl-loop for node = (treesit-node-at (point))
+          (cl-loop for node = (treesit-node-at (point) 
(treesit-language-at (point)))
                   then (treesit-node-parent node)
                   while node
                   if (eq (treesit-node-start node)


Another option might be to allow parser-or-lang as an argument, 
but
thinking that as an interactive function for debugging the above 
might
be more useful, but either way it does not seem possible to
inspect-node-at-point for multiple language configuration.

Regards,
Wilhelm




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60251; Package emacs. (Tue, 05 Sep 2023 23:33:01 GMT) Full text and rfc822 format available.

Message #8 received at 60251 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Wilhelm H Kirschbaum <wilhelm <at> floatpays.co.za>
Cc: Yuan Fu <casouri <at> gmail.com>, 60251 <at> debbugs.gnu.org
Subject: Re: bug#60251: 29.0.60; Consider the language at point for tree
 sitter treesit-inspect-node-at-point
Date: Tue, 5 Sep 2023 16:32:12 -0700
Wilhelm H Kirschbaum <wilhelm <at> floatpays.co.za> writes:

> The following change will make it possible to inspect a node when using
> an embedded language, otherwise it will assume the first specified
> language without allowing specifying the language. This assumes that
> treesit-language-at-point-function has been correctly set. diff --git

Yuan, do you have any comments on the below patch?  Thanks in advance.

> a/lisp/treesit.el b/lisp/treesit.el
> index 6407669118..74dfd26776 100644
> --- a/lisp/treesit.el
> +++ b/lisp/treesit.el
> @@ -1931,7 +1931,7 @@ treesit-inspect-node-at-point
>   (interactive "p")
>   ;; NODE-LIST contains all the node that starts at point.
>   (let* ((node-list
> -          (cl-loop for node = (treesit-node-at (point))
> +          (cl-loop for node = (treesit-node-at (point) (treesit-language-at
> (point)))
>                    then (treesit-node-parent node)
>                    while node
>                    if (eq (treesit-node-start node)
>
>
> Another option might be to allow parser-or-lang as an argument, but
> thinking that as an interactive function for debugging the above might
> be more useful, but either way it does not seem possible to
> inspect-node-at-point for multiple language configuration.
>
> Regards,
> Wilhelm




This bug report was last modified 1 year and 338 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.