Tom-Bonnike / vscode-formatting-toggle

A VS Code extension that allows you to toggle the formatter (Prettier, Beautify, …) ON and OFF with a simple click.
https://marketplace.visualstudio.com/items?itemName=tombonnike.vscode-status-bar-format-toggle
MIT License
60 stars 13 forks source link

Add `formattingToggle.statusBarLabel` settings #68

Closed dgrebb closed 1 year ago

dgrebb commented 1 year ago

What?

This is a first draft to address #67.

How?

Adds formattingToggle.text to support custom Status Bar label text.

This can be enhanced in multiple ways:

I'd be happy to write tests and build the above out further with separate PRs. Please @ me if interested and I'll wrap up this PR with tests, changes to naming convention, separating statusBarText logic out into its own helper, etc.

Thank you for your work on this excellent extension, @Tom-Bonnike!

dgrebb commented 1 year ago

Note on this @Tom-Bonnike — the .vsix build included here has the changes.

I didn't want to do any version bumping without sharing first :)

dgrebb commented 1 year ago

@Tom-Bonnike thank you for the feedback!

I'll address all of the above and resolve each comment. Thoughts on adding icon with this object composition?

formattingToggle.statusBar: {
  enabled: "Formatting enabled: $(check)",
  disabled: "Formatting disabled: $(x)"
}

We could also split apart icon and text, but I'm not sure the added complexity is worth it?

Thanks again — I'll update this soon.

dgrebb commented 1 year ago

@Tom-Bonnike I see what you mean with testing VSCode. I spent as much time as I can working through mocks and didn't succeed mocking WorkspaceConfiguration, configuration.get.

Everything else has been addressed! Thank you again for the feedback. I think this is good to go, but open to more discussion 🤝

dgrebb commented 1 year ago

@Tom-Bonnike I pulled your suggested changes and vsce started failing. Rolled back to where the branch was before changing — 2454461 is where things stand.

dgrebb commented 1 year ago

Also, the SVGs will get flagged by vsce now that they have a policy in place on the extensions market.

Tom-Bonnike commented 1 year ago

Hey, sorry I’m struggling to find time to take a look at this, aiming to test, merge & release before the end of the month 👀

dgrebb commented 1 year ago

@Tom-Bonnike I also lost track — no worries! Thank you for the collaboration and merge 😄

Tom-Bonnike commented 1 year ago

https://github.com/Tom-Bonnike/vscode-formatting-toggle/issues/67#issuecomment-1744729792 just to make sure you saw that, I'm very grateful for your work Dan!