Skip to content

Highlight field access differently from calls - #73

Merged
jonatanklosko merged 1 commit into
mainfrom
jk-field
Sep 28, 2024
Merged

jonatanklosko merged 1 commit into
mainfrom
jk-field

Conversation

@jonatanklosko

Copy link
Copy Markdown
Member

Comment thread queries/highlights.scm
operator: "|>"
right: (call
target: (dot
right: (identifier) @function)))

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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