Vscode: [themes] Offer a theme checker that reports missing theme keys

Created on 27 Jun 2019  路  8Comments  路  Source: microsoft/vscode

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

feature-request help wanted themes

All 8 comments

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

//cc @aeschli

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.

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

  • a single new developer guideline for PR's in the VS Code repository could be introduced that says to also always create a PR in the NPM package repository too when the PR changes anything regarding theme keys.
  • the NPM package parses the JSON schema for themes and generates a list of valid (+deprecated) keys of it.

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.

@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:

  • you configure to use a certain theme
  • you run the developer action
  • we print a list of keys that are not assigned in theme e.g. to an untitled editor

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

Open for other ideas how to implement this.

@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.

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?

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.

@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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

VitorLuizC picture VitorLuizC  路  3Comments

NikosEfthias picture NikosEfthias  路  3Comments

biij5698 picture biij5698  路  3Comments

mrkiley picture mrkiley  路  3Comments

omidgolparvar picture omidgolparvar  路  3Comments