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

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

Open
K4LCIFER opened this issue Jun 12, 2023 · 1 comment
Open

Comments

@K4LCIFER
Copy link

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
Copy link
Author

K4LCIFER commented Jun 12, 2023

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.

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

1 participant