Skip to content
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

Highlight field access differently from calls #73

Merged
merged 1 commit into from
Sep 28, 2024
Merged

Conversation

jonatanklosko
Copy link
Member

operator: "|>"
right: (call
target: (dot
right: (identifier) @function)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what is worth, Elixir will likely emit runtime warnings for this in the future (i.e. Elixir agrees it is a function call but it will treat the code without parens as deprecated).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You CALL!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean the same for foo |> bar?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will warn on foo |> bar in the future as well. But first we want to change the formatter to automatically add the parens.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I think it's fine to keep highlighting for now and align once is changes upstream. Highlighting rules are an easy change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, to be clear, it will always be a call. So this is correct. We will just emit warnings too.

@jonatanklosko jonatanklosko merged commit d292589 into main Sep 28, 2024
1 check passed
@jonatanklosko jonatanklosko deleted the jk-field branch September 28, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants