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

@main not colored consistently #272

Closed
NoahELE opened this issue Oct 4, 2024 · 7 comments
Closed

@main not colored consistently #272

NoahELE opened this issue Oct 4, 2024 · 7 comments

Comments

@NoahELE
Copy link

NoahELE commented Oct 4, 2024

image

Just like the screenshot above, I'm not sure why the same annotation is colored differently.

The first has semantic token class, while the second has semantic token other

image

image

@tgodzik
Copy link
Contributor

tgodzik commented Oct 4, 2024

Thanks for reporting! Looks like this is an issue with semantic highlight from Metals 🤔 does it happen consistently? I can take a look next week.

@NoahELE
Copy link
Author

NoahELE commented Oct 4, 2024

Yes, this happens consistently, usually a call to List constructor will make the @main annotation turn gray. I'm not sure what triggered this exactly.

@tgodzik
Copy link
Contributor

tgodzik commented Oct 7, 2024

Could you post the whole sample? I don't think I can reproduce it currently.

@NoahELE
Copy link
Author

NoahELE commented Oct 7, 2024

@main def main1(): Unit =
  println("Hello, world!")

@main def main2(): Unit =
  val list = List(1, 2, 3)
  print(list)

with "editor.semanticHighlighting.enabled": true in vscode settings.

Some vscode color theme does not enable semantic highlighting by default. You can either turn it on manually in setting or use a default theme like Default Dark Modern which enable it by default. I guess that might be the cause.

@tgodzik
Copy link
Contributor

tgodzik commented Oct 7, 2024

Thanks, looks like this happens if a val is in the second main, which is super curious. Do you might opening the issue under scalameta/metals ? That's where the semantic highlight is implemented

@NoahELE
Copy link
Author

NoahELE commented Oct 7, 2024

Issue opened here scalameta/metals#6823

@tgodzik
Copy link
Contributor

tgodzik commented Oct 7, 2024

Thanks!

@tgodzik tgodzik closed this as completed Oct 7, 2024
@tgodzik tgodzik closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
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

No branches or pull requests

2 participants