GNU bug report logs - #66004
[PATCH] Offset ranges before applying embeded treesit parsers

Previous Next

Package: emacs;

Reported by: Danny Freeman <danny <at> dfreeman.email>

Date: Fri, 15 Sep 2023 15:57:01 UTC

Severity: normal

Tags: patch

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 66004 in the body.
You can then email your comments to 66004 AT debbugs.gnu.org in the normal way.

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#66004; Package emacs. (Fri, 15 Sep 2023 15:57:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Danny Freeman <danny <at> dfreeman.email>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 15 Sep 2023 15:57:01 GMT) Full text and rfc822 format available.

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

From: Danny Freeman <danny <at> dfreeman.email>
To: bug-gnu-emacs <at> gnu.org, Yuan Fu <casouri <at> gmail.com>
Subject: [PATCH] Offset ranges before applying embeded treesit parsers
Date: Fri, 15 Sep 2023 11:45:00 -0400
[Message part 1 (text/plain, inline)]
Background: In clojure-ts-mode I've been capturing docstrings and
applying some limited syntax highlighting using an embedded markdown
parser. I'm only able to capture the full string, "quotes included". I
would like to be able to easily adjust the ranges captured to only
include the contents of the string, delimiters excluded. I have a
similar desire to capture the contents of a regular expression literal
and apply a nested regex grammar.

I've seen an offset mechanism used by the neovim tree-sitter integration
for similar purposes.

I believe the javascript/typescript modes could take advantage of this
with template strings. I've included a small test in the patch that
demonstrates this.

[0001-Offset-ranges-before-applying-embedded-tree-sitter-p.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
Let me know what you think.

Thank you,
-- 
Danny Freeman

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66004; Package emacs. (Sun, 17 Sep 2023 10:09:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Danny Freeman <danny <at> dfreeman.email>
Cc: casouri <at> gmail.com, 66004 <at> debbugs.gnu.org
Subject: Re: bug#66004: [PATCH] Offset ranges before applying embeded treesit
 parsers
Date: Sun, 17 Sep 2023 13:07:54 +0300
> Date: Fri, 15 Sep 2023 11:45:00 -0400
> From:  Danny Freeman via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Background: In clojure-ts-mode I've been capturing docstrings and
> applying some limited syntax highlighting using an embedded markdown
> parser. I'm only able to capture the full string, "quotes included". I
> would like to be able to easily adjust the ranges captured to only
> include the contents of the string, delimiters excluded. I have a
> similar desire to capture the contents of a regular expression literal
> and apply a nested regex grammar.
> 
> I've seen an offset mechanism used by the neovim tree-sitter integration
> for similar purposes.
> 
> I believe the javascript/typescript modes could take advantage of this
> with template strings. I've included a small test in the patch that
> demonstrates this.

Yuan, any comments?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66004; Package emacs. (Sun, 17 Sep 2023 12:12:02 GMT) Full text and rfc822 format available.

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

From: Danny Freeman <danny <at> dfreeman.email>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 66004 <at> debbugs.gnu.org
Subject: Re: [PATCH] Offset ranges before applying embeded treesit parsers
Date: Sun, 17 Sep 2023 08:05:30 -0400
Yuan Fu <casouri <at> gmail.com> writes:

> This is a good idea, thanks! I believe you’ve sighed copyright assignment, right? If so, I’ll marge this and push to master.

Thank you, and yes I've done the copyright assignment.

> BTW, I don’t see this on debbugs. Did you get a confirmation that the bug report is created? It could be my email client problem though.

I did get the email, here is debbugs link
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66004

I will CC the debbug email. This email just went straight to me.

-- 
Danny Freeman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66004; Package emacs. (Mon, 18 Sep 2023 04:13:02 GMT) Full text and rfc822 format available.

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

From: Yuan Fu <casouri <at> gmail.com>
To: Danny Freeman <danny <at> dfreeman.email>
Cc: 66004 <at> debbugs.gnu.org
Subject: Re: [PATCH] Offset ranges before applying embeded treesit parsers
Date: Sun, 17 Sep 2023 21:12:16 -0700

> On Sep 17, 2023, at 5:05 AM, Danny Freeman <danny <at> dfreeman.email> wrote:
> 
> 
> Yuan Fu <casouri <at> gmail.com> writes:
> 
>> This is a good idea, thanks! I believe you’ve sighed copyright assignment, right? If so, I’ll marge this and push to master.
> 
> Thank you, and yes I've done the copyright assignment.
> 
>> BTW, I don’t see this on debbugs. Did you get a confirmation that the bug report is created? It could be my email client problem though.
> 
> I did get the email, here is debbugs link
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66004
> 
> I will CC the debbug email. This email just went straight to me.

I didn’t CC debbugs since I didn’t know the bug number. Anyway, it seems to be my email provider’s problem.

I made some minor changes and pushed to master, thanks again!

Yuan



Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Mon, 18 Sep 2023 22:53:02 GMT) Full text and rfc822 format available.

Notification sent to Danny Freeman <danny <at> dfreeman.email>:
bug acknowledged by developer. (Mon, 18 Sep 2023 22:53:02 GMT) Full text and rfc822 format available.

Message #19 received at 66004-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 66004-done <at> debbugs.gnu.org, Danny Freeman <danny <at> dfreeman.email>
Subject: Re: bug#66004: [PATCH] Offset ranges before applying embeded treesit
 parsers
Date: Mon, 18 Sep 2023 15:52:43 -0700
Yuan Fu <casouri <at> gmail.com> writes:

> I made some minor changes and pushed to master, thanks again!

It seems like the patch was installed, but was left open in the bug
tracker.  I'm therefore closing it now.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66004; Package emacs. (Tue, 19 Sep 2023 03:36:02 GMT) Full text and rfc822 format available.

Message #22 received at 66004-done <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 66004-done <at> debbugs.gnu.org, Danny Freeman <danny <at> dfreeman.email>
Subject: Re: bug#66004: [PATCH] Offset ranges before applying embeded treesit
 parsers
Date: Mon, 18 Sep 2023 20:34:29 -0700

> On Sep 18, 2023, at 3:52 PM, Stefan Kangas <stefankangas <at> gmail.com> wrote:
> 
> Yuan Fu <casouri <at> gmail.com> writes:
> 
>> I made some minor changes and pushed to master, thanks again!
> 
> It seems like the patch was installed, but was left open in the bug
> tracker.  I'm therefore closing it now.

Thank you, Stefan.

Yuan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 17 Oct 2023 11:24:04 GMT) Full text and rfc822 format available.

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

Previous Next


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