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(#11202): special case type trees in syntax highlighting #14518

Merged
merged 1 commit into from Feb 19, 2022

Conversation

ckipp01
Copy link
Member

@ckipp01 ckipp01 commented Feb 19, 2022

This fixes #11202 and ensures that when a LambdaTypeTree is encountered
we are only highlighting the actual type params.

Before

Screenshot 2022-02-19 at 13 23 27

Screenshot 2022-02-19 at 13 24 42

After

Screenshot 2022-02-19 at 13 23 52

Screenshot 2022-02-19 at 13 25 06

@ckipp01 ckipp01 changed the title fix(#11202): special case LambdaTypeTree in syntax highlighting fix(#11202): special case type trees in syntax highlighting Feb 19, 2022
@ckipp01
Copy link
Member Author

ckipp01 commented Feb 19, 2022

So after fixing the actual issue it was bugging me that List[Int] was all one color. For example:
Screenshot 2022-02-19 at 16 13 23

This become really evident after the first commit since in a type lambda it became really obvious since the first part didn't have the brackets highlight and the second part did.

This is also how Ammonite handles this (at least in Scala 2):

Screenshot 2022-02-19 at 16 15 30

So after the second commit now in an AppliedTypeTree only the actual tpt and the args are colored with the brackets remaining as no color.

Screenshot 2022-02-19 at 16 17 29

Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

🎇

@smarter smarter merged commit 4f3d767 into scala:main Feb 19, 2022
@ckipp01 ckipp01 deleted the lambdaTypeTreeHighlighting branch February 19, 2022 22:26
@Kordyjan Kordyjan added this to the 3.1.3 milestone Aug 1, 2023
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.

Incorrect highlight for type constructor in REPL
3 participants