microsoft / theme-converter-for-vs

CLI tool that allows you to convert your VS Code color theme to a VS 2022 color theme.
MIT License
497 stars 52 forks source link

Some refactoring #95

Closed huguesv closed 2 years ago

huguesv commented 2 years ago

I've been wanting to do some cleanup for a while, here is some of it.

Program had grown to contain almost all the code. I have separated it in two, the logic to handle arguments, console input/output and VS deployment/startup remains in Program, and the conversion logic goes into Converter.

Removed that ThemeName global variable.

Removed console output from ParseMappings.

Moved some hard coded messages to string resources.

Added a test project so we can convert various valid and invalid themes, as well as ensure that our internal data files are valid. I just put a few tests in there as a starting point.

For the tests, Converter is a public type (the only one) with 2 public methods to convert a theme and validate our internal data files.

Some of the file handling code has changed slightly to make the Converter class more usable from both program and tests.

We'll update the pipeline later to run the new tests (but skip the older screenshot capture tests).

huguesv commented 2 years ago

@ketttY I'll probably check back on this in the coming days, but if you're okay with it, you don't have to wait for me, feel free to merge it.