jdinhify / vscode-theme-gruvbox

Gruvbox theme for vscode based on https://github.com/morhetz/gruvbox
https://marketplace.visualstudio.com/items?itemName=jdinhlife.gruvbox
MIT License
267 stars 63 forks source link

json syntax highlighting changes color depending on the scope depth #79

Open K4LCIFER opened 1 year ago

K4LCIFER commented 1 year ago

As you can see in the following image, the color of the keys changes depending on the scope depth: image this is rather strange behaviour. It should remain a constant color for every level of scope.

It should also be noted that the color of the values are affected as well.

K4LCIFER commented 1 year ago

From what I can see, it has to do with lines 646-680 in the theme files. For example, in gruvbox-dark-medium.json, (lines 646-680) we have

{
      "name": "JSON Level 0",
      "scope": [
        "source.json meta.structure.dictionary.json support.type.property-name.json"
      ],
      "settings": {
        "foreground": "#b8bb26"
      }
    },
    {
      "name": "JSON Level 1",
      "scope": [
        "source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json"
      ],
      "settings": {
        "foreground": "#8ec07c"
      }
    },
    {
      "name": "JSON Level 2",
      "scope": [
        "source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json"
      ],
      "settings": {
        "foreground": "#d3869b"
      }
    },
    {
      "name": "JSON Level 3",
      "scope": [
        "source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json"
      ],
      "settings": {
        "foreground": "#b8bb26"
      }

This is the source of the weirdness. I'm not entirely sure why this is all hardcoded in this way. I suspect that removing these lines might solve the problem.