Enable prettier formatter in monaco
Description
- Add
prettierto Sandcastle to format code in monaco- This aligns with the rest of Cesium's code so gallery examples should format the same as the source
- Update monaco default settings
- I did a pass on all the editor options and toggled a handful to increase the user experience.
- I really struggled not to turn on all the extra stuff that fits my personal preference :sweat_smile:
Issue number and link
Part of #12566
Testing plan
- Write any code in Sandcastle
- Click
Formatand make sure it works for JS and HTML with no errors - Make sure the formatted code matches what you'd expect from prettier
Author checklist
- [ ] I have submitted a Contributor License Agreement
- [ ] I have added my name to
CONTRIBUTORS.md - [ ] I have updated
CHANGES.mdwith a short summary of my change - [ ] I have added or updated unit tests to ensure consistent code coverage
- [ ] I have updated the inline documentation, and included code examples where relevant
- [ ] I have performed a self-review of my code
Thank you for the pull request, @jjspace!
:white_check_mark: We can confirm we have a CLA on file for you.
I really struggled not to turn on all the extra stuff that fits my personal preference 😅
We all have editor preferences, and some user expressed interest in disabling as much as possible. How tricky would it be to add a settings menu to turn features on and off?
@ggetz functionally it shouldn't be that hard. However it would probably be a lot of effort to pick and choose which of the 150+ options we want to expose and allow changing
I would rather we stick mostly to defaults with the few opinionated changes I've already made. Monaco shouldn't really get in the way of people just "typing in code".
If we get feedback that it's too much after trying it we can potentially add a single toggle for a "plain text" mode that turns off nearly everything.
However it would probably be a lot of effort to pick and choose which of the 150+ options and allow changing...If we get feedback that it's too much after trying it we can potentially add a single toggle for a "plain text" mode that turns off nearly everything.
Yes, I agree that approach it with that kind of fine-toothed comb would be a loosing battle.
At the very least, we are already allowing user to toggle dark and light modes, so I don't think it would hurt to have a settings area for that plus maybe one or two "controversial" options. From there, we could make small changes based on user feedback, right?
@jjspace Code is all looking good. Could you please
- merge in the feature branch, and
- address or document https://github.com/CesiumGS/cesium/pull/12640#issuecomment-2971395229 in https://github.com/CesiumGS/cesium/issues/12566
? This should then be good to merge.
Thanks @ggetz this should be good to go now. Slightly annoying merge but it looks cleaned up now. I'll add a todo to track user settings including the editor settings
Awesome, thanks @jjspace!