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

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

bug#61302: 29.0.60; rust-ts-mode does not show function-invocation on fi


From: Dmitry Gutov
Subject: bug#61302: 29.0.60; rust-ts-mode does not show function-invocation on field-properties
Date: Sun, 5 Feb 2023 23:56:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

Hi Randy,

Maybe I was too quick to commit the change. But let's discuss it.

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?

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.

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






reply via email to

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