Unibeautify / beautifier-prettier

Prettier beautifier for Unibeautify
MIT License
3 stars 4 forks source link

Editor settings UI #11

Open stevenzeck opened 6 years ago

stevenzeck commented 6 years ago

Thinking about the various editors (Atom, Sublime, VS Code) and how they should present options to the user. I've not used Sublime or VS Code and I'm not 100% sure how the integrations with all of the packages will work there. But with Atom Beautify it sounds like the direction we're taking is to have each beautifier be it's own Atom package. So beautifier-prettier here would have to be installed as an Atom package for it to be used by Atom Beautify.

This presents an opportunity to spread the options out per beautifier versus cramming them all into Atom Beautify, so the beautifier-prettier package would show all of the options listed https://github.com/Unibeautify/beautifier-prettier/blob/master/src/index.ts#L11-L60.

I have no idea how to take those options and "look them up" in Unibeautify's OptionsRegistry to get the title, description, etc, so if that's the direction to take I would need some guidance there.

Thoughts/feedback?

Glavin001 commented 6 years ago

The beautifier specific options will be exposed by unibeautify-beautifier wrapper, depending on the environment (e.g. Atom). See https://github.com/Unibeautify/unibeautify-beautifier/blob/master/src/beautifier.ts#L46

This works for Atom because it has a Services API: http://blog.atom.io/2015/03/25/new-services-API.html However, VS Code and Sublime do not have such a feature. I was thinking we would utilize some form of discovery like https://github.com/Unibeautify/unibeautify-cli uses. Similar to Atom users installing individual beautifiers as Atom/apm packages, VS Code and Sublime users would install the Node.js/npm version of the beautifiers package and use those.

Here's some documentation on the available options per beautifier: https://unibeautify.github.io/docs/beautifier-prettier.html

Unibeautify itself will have a new configuration file format, .unibeautifyrc (using https://github.com/davidtheclark/cosmiconfig ) and will include choosing which beautifiers to apply.

Atom will have a GUI (with https://atom.io/packages/settings-view ). VS Code will provide contributes.configuration: https://code.visualstudio.com/docs/extensionAPI/extension-points#_contributesconfiguration Not sure what Sublime convention is.

stevenzeck commented 6 years ago

OK got it. For populating the config const in each of the individual beautifiers, is there a method that does that yet?

Glavin001 commented 6 years ago

Not yet. This still needs to be designed and developed.