microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.59k stars 29.03k forks source link

[themes] Offer a theme checker that reports missing theme keys #76243

Open octref opened 5 years ago

octref commented 5 years ago

In this iteration we added tree.indentGuidesStroke. I had to open an issue for my fav theme, but there would be countless themes that's not updated.

We should have a theme checker that would report themes that's not specifying newly added keys.

/cc @bpasero @Tyriar

bpasero commented 5 years ago

I am not convinced, I think the best themes will win that update themselves frequently. That is just natural selection?

//cc @aeschli

Tyriar commented 5 years ago

Also themes aren't meant to use all keys imo, we should be calling out the new ones in release notes and theme authors can always diff manually if they want.

arcticicestudio commented 5 years ago

I'm the creator of the Nord theme and I'd really appreciate to have a helper tool like this to keep up with the regular changes.

Maybe it's not necessary to directly implement this into VS Code, but creating a NPM package that is officially maintained by the VS Code team would be already enough. As an example, there is a package called eslint-find-rules that I also use for my ESLint rule presets and it really helps to keep up-to-date with the frequent updates of ESLint. The package is on average downloaded over 15k times a day so it's definitely a common use case and it's also co-maintained by the core maintainer of the famous Airbnb JavaScript style guide and ESLint presets since it also helps to maintain their packages.

@bpasero @Tyriar I agree with your argument that this is kind of a "natural sorting of good themes" and that a theme author should care about the upstream application it has been developed for by adapting to changes, but not everyone has the time (or gets paid) to actively maintain open source projects or in my case when maintaining more than 35 other repositories of a color theme + a many other projects (+job etc.).

One could argue now that a theme creator could create the theme key checker NPM package, but in the required effort would be the same: Manually crawling through release notes as well as hundreds of commits in order to find all new/modified/deprecated/removed theme keys.

I think it won't take much time to create such a package and to maintain it either

Regarding the fact that not every theme makes use of every theme key: The package could provide a way (config file, CLI flag etc.) to allow theme authors to define keys that should be ignored.

To keep the NPM package also up-to-date it could be added to VS Code's automated CI/CD pipeline by always pushing a new tagged NPM package version as soon as a new VS Code gets prepared and deployed.

Sorry for the wall of text, but I'd like to bring in some ideas so this request might be accepted without taking too much effort.

bpasero commented 5 years ago

@arcticicestudio thanks for your input and btw I really like your theme 👍 .

Let's see what we can do here, I am happy to review a PR that implements this maybe as part of our "developer" related actions (link).

The way I could see this work is:

Alternatively we go over all installed themes and produce this list for all themes.

Open for other ideas how to implement this.

arcticicestudio commented 5 years ago

@bpasero Thanks for the kind words 😊 A developer action sounds like a great idea and would fit well to the already existing action >Developer: Generate Color Theme From Current Settings to allow user to verify and lint their newly created color theme before using/publishing it.

Tyriar commented 5 years ago

This seems like something that should not be bundled with vscode in the interest of reducing bloat? Someone could build an npm package that extracts and exposes all the keys from https://code.visualstudio.com/api/references/theme-color or from the vscode code base?

octref commented 5 years ago

This should be automate-able as well. Programmatically run find references on registerColor in colorRegistry.ts and for each result, extract the color name/deafult/nls-name and output them into a JSON.

Or expose a command to ask ColorRegistry all keys.

nrayburn-tech commented 4 years ago

@Tyriar, @bpasero I think that I can implement something that does what is mentioned above using the developer action. Should I submit a PR for this, or is this something that should be done in a separate npm package?

nrayburn-tech commented 3 years ago

This can probably be closed with https://github.com/microsoft/vscode/commit/1436b523d4aaa773ab246daa68daaa70cef48b1d. All colors are output now, if the color isn't specified then it is output with the default or null as a comment.

{
    "$schema": "vscode://schemas/color-theme",
    "type": "dark",
    "colors": {
        "activityBarBadge.background": "#007acc",
        "editor.background": "#1e1e1e",
        "editor.foreground": "#d4d4d4",
        //"activityBar.activeBorder": "#ffffff",
        //"activityBar.background": "#333333",
        //"activityBar.activeBackground": null,
        //"activityBar.activeFocusBorder": null,
    }
}