bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66004: [PATCH] Offset ranges before applying embeded treesit parsers


From: Danny Freeman
Subject: bug#66004: [PATCH] Offset ranges before applying embeded treesit parsers
Date: Fri, 15 Sep 2023 11:45:00 -0400

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.

Attachment: 0001-Offset-ranges-before-applying-embedded-tree-sitter-p.patch
Description: Text Data

Let me know what you think.

Thank you,
-- 
Danny Freeman

reply via email to

[Prev in Thread] Current Thread [Next in Thread]