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

Fix as import renaming in Scala 3 #175

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

keynmol
Copy link
Collaborator

@keynmol keynmol commented Jan 22, 2023

In Scala 3, you can rename a single identifier without the curly braces if you use as
Doesn't work with =>

)),
'}'
),

// deprecated: Remove when highlight query is updated for Neovim
_import_selectors: $ => alias($.namespace_selectors, $.import_selectors),

renamed_identifier: $ => seq(
arrow_renamed_identifier: $ => seq(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I split the renamed_identifier node as it was a low-tech solution to prevent parsing code that is invalid in Scala 3.

If that's unacceptable, then we can loosen the restriction and use the old renamed_identifier node and just parse incorrect code, if it's for the purspose of highlighting anyways.

Copy link
Collaborator

Choose a reason for hiding this comment

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

My opinion would be that this is probably fine.

Copy link
Collaborator

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

LGTM too

@keynmol keynmol merged commit d67e84c into tree-sitter:master Jan 24, 2023
@keynmol keynmol deleted the fix-import-renaming branch January 24, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants