Possible to fold all indented code in script editor?
-
I find navigating the HISE code editor a bit messy and I can't rely on the tools I'm used to using in Sublime like fold all code at indent level 1,2,3 etc.
Is there a way to do this in HISE?
Or are there other smart ways to make code navigation a bit easier?
Like connecting it to an IDE or working with several script tabs? -
Or are there other smart ways to make code navigation a bit easier?
Write less code per file. Use namespaces and separate your code into different files. The majority of my scripts rarely exceed 300 lines, which is easily manageable. You can view the scripts in Rhapsody to see how I manage them in my projects - https://codeberg.org/LibreWave/Rhapsody
Pressing CTRL+R will open the bookmarks in your script so you can quickly jump to different parts.
@observantsound said in Possible to fold all indented code in script editor?:
fold all code at indent level 1,2,3
Try to have fewer indent levels. It will (generally) result in cleaner code. https://youtu.be/CFRhGnuXG-4?si=EqroDdGRTIwbTHPa
@observantsound said in Possible to fold all indented code in script editor?:
working with several script tabs?
I always have multiple tabs open. If you get creative with a custom layout you can get all kinds of nice setups.
-
@d-healey Thanks for the tips!
I might need to adjust my workflow then.I was following some of your tutorials for interface design and I quickly lost track of what is where.
This is how I like to structure my code. I use fold on indent level x many times to quickly find what I'm looking for.
I also don't feel comfrotable with using the { } yet.
Sure it might make some things easy to read but it also makes the vertical space code needs very long.Is it possible to have one file for all my Lafs, one file for my PaintRoutines, one file for declarations etc. ?
// ------------------------------------------------ // SET PAINT ROUTINES // ------------------------------------------------ inline function A_PaintRoutine(g){ inline function B_PaintRoutine(g){ inline function C_PaintRoutine(g){
-
@observantsound said in Possible to fold all indented code in script editor?:
Is it possible to have one file for all my Lafs, one file for my PaintRoutines, one file for declarations etc. ?
Yes but beyond one file for laf i wouldn't advise that approach.
Split your project code by functionality. If you have code for your preset browser, for example, put it in a file called PresetBrowser.js and everything associated with the preset browser ( paint routines, component references, laf, etc) goes in that file. This will make it really easy to find things in the future. If there's a problem with the preset browser you'll know exactly where to look.
-
Here's a partial list showing the sort of thing I (and it seems David) do:
// THE SOUND SOURCES include("VoiceModels.js"); // LAF // include("LAF.js"); include("PatternPreLoader.js"); // THE HEADER CONTROLS include("HeaderControls.js"); // MASTER CONTROLS include("MasterControls.js"); // EDITOR CONTROLS include("EditorControls.js"); // REALISM CONTROLS include("RealismControls.js"); // THE STD CONTROLS // include("StdControls.js"); // SAMPLER AREA include("Samplers.js"); // SYNTH OSCILATOR AREA //include("Synths.js"); // ENVELOPES AREA // include("GainEnvelopes.js"); // FILTER AREA // include("Filters.js"); // FILTER ENVELOPES include("FilterEnvelopes.js"); // TREM VIB AREA include("VibTremSpace2.js"); // UNISON AREA include("UnisonSpace.js"); // CONTROL AREA include("ControlSpace2.js"); // FM AREA include("FMSpace.js"); // LOOP PLAYER //include("LoopPlayerAndBrowser.js"); // THE FX AREA // include("SendEffects2.js"); include("MasterEffects2.js"); //include("update.js"); // the ARP include("Arp.js"); // the CHORD PLAYER include("chordplayer.js"); /// the RANGE SETTERS include("RangeSetters.js"); // SETTINGS // include("settingsspace.js"); // SOUND BROWSER // //include("SoundDataLoader.js"); //include("SoundBrowser.js"); include("VoiceExpansions.js"); include("voicetaggingSelector.js"); // SOUND randomisation include("SoundRandomiser.js"); // Authorisation & Demo include("Authorisation.js"); // THE GLOBAL MODULATORS // include("GlobalModulators.js"); //PRESET BROWSER include("PresetBrowser.js"); include("presettagging01.js"); //PATHS include("Paths.js");