Skip to content

[3.24.0 ver] is messing up Monokai/Abyss Theme #3458

Closed

Description

@Shiba-Kar

Describe the bug
When on Monokai/Abyss Theme proper color coding is messed up.
Observed this when the Analyzer finishes analyzing the Flutter code. During the analyzing process the theme is proper.

To Reproduce
Steps to reproduce the behavior:

  1. Install Flutter extension
  2. Change Theme to Simple Monokai or Abyss .

Screenshots
Screenshot (11)

**Versions **

  • VS Code version: 1.57.1
  • Dart extension version: 3.24.0
  • Dart/Flutter SDK version: 3.24.0

Activity

  1. DanTup commented on Jul 4, 2021

    @DanTup
    Member

    When on Monokai/Abyss Theme proper color coding is messed up.

    Can you be more specific about which part you think is incorrect? Syntax highlighting now uses LSP's semantic tokens and should be more accurate. Previously, the syntax highlighting was regex based and not quite as accurate, so the new behaviour should better match the theme.

    If you can give some specific examples of things that you think are now coloured incorrectly, I'll take a look. Thanks!

  2. added
    awaiting infoRequires more information from the customer to progress
    on Jul 4, 2021
  3. Shiba-Kar commented on Jul 4, 2021

    @Shiba-Kar
    Author

    When ever I switch to Monokai/Abyss Theme there is underlines in classes and methods which is not normal in these themes.
    One more observation this issue is present in my resent projects the older ones works perfectly.

  4. weakvar commented on Jul 5, 2021

    @weakvar

    Hey there! I'm using a light theme from GitHub. After updating, parameters are now yellow. Also noticed that the @override annotation is not correctly highlighted (@ is red, override is black).

    Should we now look for another appropriate theme for code highlighting, or is this a bug in the extension and it will be fixed in the near future?

    Before

    before

    After

    after

  5. DanTup commented on Jul 5, 2021

    @DanTup
    Member

    @Shiba-Kar

    When ever I switch to Monokai/Abyss Theme there is underlines in classes and methods which is not normal in these themes.
    One more observation this issue is present in my resent projects the older ones works perfectly.

    As far as I can tell, this is coming from the theme. Class names are defined as being underlined:

    https://github.com/microsoft/vscode/blob/main/extensions/theme-monokai/themes/monokai-color-theme.json#L204-L211

    Screenshot 2021-07-05 at 10 40 00

    Here's a screenshot of some TypeScript code using that theme and shows the same:

    Screenshot 2021-07-05 at 10 55 25

    These may have not shown up previously because the syntax highlighting was not using semantic tokens until recently. If you're seeing different highlighting in some of your projects, it's possible you have either LSP or semantic tokens disabled for those projects.

  6. DanTup commented on Jul 5, 2021

    @DanTup
    Member

    @weakvar the orange parameters seem to come from VS Code mapping the parameter token onto the variable.parameter textmate scope and the theme seems to define variables as orange:

    Screenshot 2021-07-05 at 10 46 47

    Screenshot 2021-07-05 at 10 47 05

    This seems to match the colouring in TypeScript too, so I believe it's also correct and as the theme defines it.

    Screenshot 2021-07-05 at 10 47 41

    Also noticed that the @override annotation is not correctly highlighted (@ is red, override is black).

    This one is definitely a little more controversial. The @ is coloured as an "annotation", but the rest of the annotation is coloured semantically (it should therefore match the colour of whatever that part is, whether it's a getter, a constructor, etc):

    Screenshot 2021-07-05 at 10 50 39

    You can disable semantic tokens if you prefer the old textmate grammar colouring, or you could customise these token colours in your settings to change them as you'd like.

    Hope this makes sense!

  7. weakvar commented on Jul 25, 2021

    @weakvar

    Hey everyone who faced the same problem. To fix this issue, you have to turn off semanticHighlighting in the Visual Studio Code settings.

  8. DanTup commented on Jul 26, 2021

    @DanTup
    Member

    Turning off semantic highlighting is an option, but you'll miss out on getting proper semantic tokens (for example if you name a method get or set it will be coloured incorrectly, and you may also get less accurate colourings in things like string interpolation).

    A better option may be better to pick a theme (or customise your theme) to look how you'd like with semantic tokens.

    I don't think there's anything to do here so I'll close this. I believe things are working as intended, even if they seem different/unexpected. If you find things that don't seem to be coloured as the theme source suggests though, please do file issues. Thanks!

  9. added and removed
    awaiting infoRequires more information from the customer to progress
    on Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions