GNU bug report logs - #61302
29.0.60; rust-ts-mode does not show function-invocation on field-properties

Previous Next

Package: emacs;

Reported by: jostein <at> kjonigsen.net

Date: Sun, 5 Feb 2023 20:16:01 UTC

Severity: normal

Found in version 29.0.60

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


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

From: Randy Taylor <dev <at> rjt.dev>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: jostein <at> kjonigsen.net, 61302 <at> debbugs.gnu.org
Subject: Re: bug#61302: 29.0.60;
 rust-ts-mode does not show function-invocation on field-properties
Date: Mon, 06 Feb 2023 02:06:23 +0000
On Sunday, February 5th, 2023 at 16:56, Dmitry Gutov <dgutov <at> yandex.ru> wrote:
> Hi Randy,
> 
> Maybe I was too quick to commit the change. But let's discuss it.

No, it's fine. You can also see my reply to Jostein.

BTW thanks for your work on the other modes and sorry for my lack of replies, I've been busy as of late.

> 
> On 05/02/2023 23:30, Randy Taylor wrote:
> 
> > That's expected (at least to me) because it's a property.
> 
> 
> It's both a property and a function, isn't it?

Sure. But it's still a property, and I wanted them all highlighted the same (or at least the ability to do so).

> 
> > The same
> > applies to c-ts-mode and go-ts-mode as well.
> 
> 
> Regarding c-ts-mode, it might be a simple oversight, given that
> constructs like
> 
> p->handler (it)
> 
> 
> do not come up very often. But if we take js-ts-mode, for example, where
> a property is often a function, the property name is highlighted as a
> function in a funcall.

Maybe in c-ts-mode it's not common, but in c++-ts-mode it is and it shares those rules.

> 
> And speaking of c-ts-mode, this can fix that omission:
> 
> diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
> index 5093c3980b6..3740130be30 100644
> --- a/lisp/progmodes/c-ts-mode.el
> +++ b/lisp/progmodes/c-ts-mode.el
> @@ -470,7 +470,9 @@ c-ts-mode--font-lock-settings
> :language mode
> :feature 'function
> '((call_expression
> - function: (identifier) @font-lock-function-name-face))
> + function:
> + [(identifier) @font-lock-function-name-face
> + (field_expression field: (field_identifier)
> @font-lock-function-name-face)]))
> 
> :language mode
> :feature 'variable

Haven't tested it, but the patch looks good to me, thanks.




This bug report was last modified 2 years and 91 days ago.

Previous Next


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