-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(theming): separate highlight for function declarations #4892
base: master
Are you sure you want to change the base?
Conversation
Sublime/TextMate use
https://www.sublimetext.com/docs/scope_naming.html#entity WDYT @the-mikedavis should we introduce the |
Actually, a better option would be |
Yeah I think I would also prefer to change the function invocation scope instead of the definition scope. Changing the definition scope is tricky because a function definition could also be a method so you would need some way to combine those scopes |
@archseer should this maybe rather be |
Add separate highlighting scope for function (and method) declarations that allows styling the declarations differently from their calls.
So I tried to experiment with the approach above but the issue I am hitting is: I want to distinguish function/method declarations and function/method calls. With the approach where new scope is added (e.g. Keeping both function declaration and calls under stingle scope makes things very verbose if we want to add the ability to distinguish between those two, e.g. given:
if I wanted to distinguish declaration from call I would have to add:
which is imho sub-optimal as it mixes declarations and calls breaking the inheritence benefits. Thus I wonder if following proposal would make sense: we add 2 scopes under function:
Theoretically, this could also be extended to remove |
7d90a65
to
8d79015
Compare
nvim-treesitter uses I think you have a point with My proposal:
|
[proposal]
Add separate highlighting scope for function (and method) declarations that allows styling the declarations differently from their calls. I noticed that in some editors the function declaration are styled differently from function calls which wasn't possible with the current highlight scopes.
If this gets the green light I will take a look at more languages and if they could be adjusted as well (although the scope of languages I am familiar with is quite limited).
Open question: do we also want to be able to style function and method declarations differently? Maybe adding also
function.declaration.method
would work.Showcase:
after
before