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

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

bug#60087: 29.0.60; c++-ts-mode conflict with electric-pair-mode


From: Daniel Martín
Subject: bug#60087: 29.0.60; c++-ts-mode conflict with electric-pair-mode
Date: Thu, 15 Dec 2022 22:34:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin)

João Távora <joaotavora@gmail.com> writes:

> I don't know how this can work if '<' is going to be used to input
> the less-than operator.  I think more complex syntax-propertization
> functionality is going to be needed here.  I don't have a tree-sitter
> build to test, but I'd say that the tree-sitter backend should be asked
> about what kind of '<' and '>' we're talking about.  AFAICT, just
> saying that '<' has the delimiter syntax in C++ is wrong. It's not
> like '(' or '{.'

Yes, you are right.  I think for now it's better to consider them as
punctuation.

A better idea may be to add a syntax-table text property to "<" and ">"
when they define a C++ template (or a Java generic).  Tree-sitter can
match something like a "template_argument_list" node easily, but I
wonder how to keep this information in sync with the buffer text in the
most efficient way?

I thought about adding a custom parser notifier via
treesit-parser-add-notifier and remove/add the text properties for the
template argument list delimiters.  WDYT?  Of course, C would not use
this extra processing at all.  I've CC'ed Yuan for feedback.




reply via email to

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