-
Notifications
You must be signed in to change notification settings - Fork 155
Add syntax highlight to function calls #506
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
Add syntax highlight to function calls #506
Conversation
This supports function calls without parenthesis only if prepended by the module name, otherwise parenthesis are mandatory for a function call to be detected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice ✨
I like this. The only things I'm not sure of:
|
@CaiqueMitsuoka @jbodah just added more tests, please LMK if I forgot some important test. I did set the default group to |
|
||
it 'does not highlight terms without a parentheresis' do | ||
expect(<<~'EOF').not_to include_elixir_syntax('elixirFunctionCall', 'func') | ||
func |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to confess I completely forgot we could use atoms as module names. Just pushed a commit to fix that.
Also, while at it I realised |> func
should also be highlighted since if we are piping it is not ambiguous that we are calling a function.
I want to give this a bit more manually testing; will get back to this by end of week |
Can this be merged? |
The only thing I'm iffy on in this branch is that functions without args and parens aren't detected which feels misleading. I am okay to merge this as long as we match these to The original branch was removed, so I will copy this over to a new branch, remove the link, and merge |
Implementation from #506 cc: Thanks @w-sanches
Implementation from #506 cc: Thanks @w-sanches
Description
Function call highlight was added to elixir syntax highlight on Sublime Text and I thought that was a neat addition as it makes it easier to scan what are function vs variables in the code. I propose we can also add this to our Vim syntax highlight.
Result