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

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

bug#61655: [Tree sitter] [Feature Request] font-lock function calls, def


From: Dmitry Gutov
Subject: bug#61655: [Tree sitter] [Feature Request] font-lock function calls, definitions, separately
Date: Wed, 22 Feb 2023 01:24:48 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 21/02/2023 17:31, Jacob Faibussowitsch wrote:
> but maybe a better default is to leave these faces totally blank and
> just purely `:inherit` from `font-lock-function-name-face`

I believe so.

+(defface font-lock-function-call-face
+  '((t :inherit font-lock-function-name-face :foreground "royalblue1"))
+  "Font Lock mode face used to highlight function calls."
+  :group 'font-lock-faces)

This one I was thinking of as well.

+(defface font-lock-member-function-call-face
+  '((t :inherit font-lock-function-name-face :foreground "brightred"))
+  "Font Lock mode face used to highlight member function calls."
+  :group 'font-lock-faces)

What's a "member function"? Is it like a method? If people want this distinction, we can add such face. But I'm curious whether some other editors use different colors for these cases.

I'm also wondering what face we're supposed to use for "receiver-less" method calls, such as calls to the methods defined in the same class, in e.g. Ruby and Java. Or C++/C#. They don't use 'this'.

I think more importantly, we need a new face for variables.

font-lock-variable-ref-face ?

I also wonder whether we'll need to separate faces for properties: definitions vs. uses. That one we could use to do early, to keep the names uniform, e.g. we'd have:

  font-lock-function-name-face
  font-lock-function-call-face
  font-lock-variable-name-face
  font-lock-variable-ref-face
  font-lock-property-name-face
  font-lock-property-ref-face





reply via email to

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