sdras / night-owl-vscode-theme

🌌 NIGHT OWL: A VS Code dark theme for contrast for nighttime coding, 🦉 LIGHT OWL: a daytime light theme
https://aka.ms/nightowl
MIT License
2.81k stars 242 forks source link

Inconsistent `const` keyword highlighting (JavaScript/TypeScript) #289

Closed HappyTiptoe closed 2 years ago

HappyTiptoe commented 3 years ago

Please make sure you're using the latest version of the plugin before submitting an issue Using v2.0.0, set to "Night Owl".

Screenshots image

As you can see in the screenshot, the const keyword is correctly highlighted pink in a normal context, but becomes blue when it's inside an object using the ES2015 shorthand method name syntax.

This is similar to, but a different context from, #237.

Thanks!

defytheflow commented 2 years ago

@ebxn, try adding these to your settings.json

  "editor.tokenColorCustomizations": {
    "[Night Owl][Night Owl (No Italics)]": {
      "textMateRules": [
        {
          "scope": [
            "meta.object.member.ts meta.var.expr.ts storage.type.ts",
            "meta.object.member.tsx meta.var.expr.tsx storage.type.tsx",
            "meta.object.member.js.jsx meta.var.expr.js.jsx storage.type.js.jsx",
            "meta.objectliteral.ts meta.var.expr.ts storage.type.ts",
            "meta.objectliteral.tsx meta.var.expr.tsx storage.type.tsx",
            "meta.objectliteral.js.jsx meta.var.expr.js.jsx storage.type.js.jsx"
          ],
          "settings": {
            "foreground": "#C792EA"
          }
        }
      ]
    }
  },
HappyTiptoe commented 2 years ago

Hiya @defytheflow,

Thanks for your response! I regret to inform you that it doesn't seem to have worked in this instance :(

You can find my VSCode settings here.

(left: TypeScript file, right: VSCode's settings.json) image

defytheflow commented 2 years ago

@ebx,

My bad, the third string in the scope array must have a .ts extension at the end of every scope.

I've edited my answer, try now.

I associate every typescript file to typescriptreact, so didn't notice it.

HappyTiptoe commented 2 years ago

Hey @defytheflow,

Sorry for the slow response. I can confirm your solution works!

Thanks very much for the help.

image