From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#66004: [PATCH] Offset ranges before applying embeded treesit parsers Date: Sun, 17 Sep 2023 13:07:54 +0300 Message-ID: <831qexglj9.fsf@gnu.org> References: <87o7i32zxz.fsf@dfreeman.email> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4676"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, 66004@debbugs.gnu.org To: Danny Freeman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 17 12:09:19 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qhoiK-00011q-Nj for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Sep 2023 12:09:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qhoi6-0003ne-8J; Sun, 17 Sep 2023 06:09:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhoi0-0003n7-8E for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2023 06:08:56 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qhohy-0003sn-Bl for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2023 06:08:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qhoi5-0003SP-SV for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2023 06:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Sep 2023 10:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66004 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66004-submit@debbugs.gnu.org id=B66004.169494529213225 (code B ref 66004); Sun, 17 Sep 2023 10:09:01 +0000 Original-Received: (at 66004) by debbugs.gnu.org; 17 Sep 2023 10:08:12 +0000 Original-Received: from localhost ([127.0.0.1]:49103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhohI-0003RF-5g for submit@debbugs.gnu.org; Sun, 17 Sep 2023 06:08:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhohG-0003R3-A1 for 66004@debbugs.gnu.org; Sun, 17 Sep 2023 06:08:10 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhoh3-0003ju-ER; Sun, 17 Sep 2023 06:07:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=W/nxRyak+vmNcoxKWmgtY6gqiHvOxMxXG6tGeLYnLnQ=; b=EtpKC/ppfoxO rHk6fRQ7otyIzSEYcvnSi2wQjJMtdUFaH34YBvIBNTbPHfYRLanX0jXTV1/WCAubyj/izMaqEdXyL gJFJ2Yr++q2oILLPym+uZCGbmAVRule+LfPNGmA2D+ogSL4dlzwZ0oblv3E3RE9V1q0vGsUWmhW/0 6yBV5+BTu9gU3DktBKhR0WzLxjTx4snplqWFz7hF1S4EKkuzs/1j1wy7QTbby3HFIdafPwuc8OEY/ i13UNQ2BY92MWAvnIf8zCVytgzozoExGjjlkvu939KY7st92TpiWJIAgtkCx6QLzhlPuSmgqffx+t syNNL4kOmVPu837jTOzZKg==; In-Reply-To: <87o7i32zxz.fsf@dfreeman.email> (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:270686 Archived-At: > 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" > > 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?