GNU bug report logs - #75609
Hideshow support for treesitter

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Thu, 16 Jan 2025 17:50:01 UTC

Severity: wishlist

Tags: patch

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Yuan Fu <casouri <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 75609 <at> debbugs.gnu.org
Subject: bug#75609: Hideshow support for treesitter
Date: Mon, 27 Jan 2025 17:52:06 -0800

> On Jan 27, 2025, at 11:11 AM, Juri Linkov <juri <at> linkov.net> wrote:
> 
>>> +(defun treesit-hs-inside-comment-p ()
>>> +  (let ((thing (or (treesit-thing-at (point) "comment")
>>> +                   (unless (bobp)
>>> +                     (treesit-thing-at (1- (point)) "comment")))))
>>> +    (when thing
>>> +      (list (treesit-node-start thing) (treesit-node-end thing)))))
>>> +
>> 
>> FYI some grammar calls comments line_comment and block_comment.  Maybe
>> use the comment thing first, and then match “comment” with the node type?
> 
> Now this tries to use the comment thing first, and then falls back to “comment”.

FWIW I don’t have other comments :)

Yuan



This bug report was last modified 164 days ago.

Previous Next


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