Closed NoahELE closed 2 weeks ago
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.
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.
Could you post the whole sample? I don't think I can reproduce it currently.
@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.
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
Issue opened here https://github.com/scalameta/metals/issues/6823
Thanks!
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 tokenother