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 23:39:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 22/02/2023 20:07, Jacob Faibussowitsch wrote:
What's a "member function"? Is it like a method?
Yeah, I suppose method is the more general term for it.

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 personally do not; I brought it up because it was functionality that the 3rd 
party package had over stock. I think a good representative list is the one 
vscode offers:

https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide#standard-token-types-and-modifiers

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 don’t think emacs should worry about differentiating these cases. Highlight 
those tokens as tree-sitter sees them; regular function calls (i.e. 
`font-lock-function-call-face`). It’s a problem you cannot accurately solve 
without playing the compiler — with all of the implementation and not to 
mention performance baggage that comes with it.

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:
This is something (also 3rd party package) lsp-mode supports through their 
semantic highlighting. They further distinguish between read and writes to 
variables. But again, they are able to do so because they hook directly into 
compilers.

Thank you, then I guess we can skip that distinction, at least for now.





reply via email to

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