GNU bug report logs -
#60087
29.0.60; c++-ts-mode conflict with electric-pair-mode
Previous Next
Reported by: Eason Huang <aqua0210 <at> foxmail.com>
Date: Thu, 15 Dec 2022 11:34:02 UTC
Severity: normal
Found in version 29.0.60
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
João Távora <joaotavora <at> 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.
This bug report was last modified 2 years and 142 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.