Auto Code Formatting
-
What's the possibility of implementing a code formatter (maybe Prettier, it's MIT https://github.com/prettier/prettier) into HISE's script editor?
The implementation would need to have the following functionality:
Right click context menu in the script editor would have these entries:
- format script
- format selection
- enable format on save (preset and xml)
A configuration file somewhere in HISE (unless creating a UI popup in tools or somewhere isn't complex) to tweak some preferences. Prettier isn't super customizable if I'm not wrong, at least that's how its VSC implementation works. But some basic stuff would that should be possible and that most people will care about would be
- how many spaces in a tab
- whether curly brackets open in a new line
-
@aaronventure Honestly I would much rather like to have a button in HISE which reloads and compiles the project again. That way we could use our favourite IDE like Sublime or VScode with all the bells and whistles.
We could write our own plugins for HISE Script, save snippets, use prettier code formatting and even code with Github Copilot. Using the built in Editor in HISE can sometimes be really painful, jumping between files and tabs.
Also its really annoying if you make HISE crash with some written code and need to jump into a external editor to fix the code so that HISE launches again because it would not let you edit the code.
I am currently working on a Language Server Extension for HISE Script (similar to this project) so that we can use the super reliable auto completion of VSCode.
https://github.com/Levitanus/HISEScript-Sublime
@Christoph-Hart please consider this feature and add a button which reloads and compiles the current .xml.