HISE Logo Forum
    • Categories
    • Register
    • Login

    Using external Text Editor

    Scheduled Pinned Locked Moved General Questions
    scripttext editorcode editor
    28 Posts 8 Posters 1.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • d.healeyD
      d.healey
      last edited by

      I sometimes use an external editor (Atom) for editing sample maps, presets, and other non-script files.

      Libre Wave - Freedom respecting instruments and effects
      My Patreon - HISE tutorials
      YouTube Channel - Public HISE tutorials

      1 Reply Last reply Reply Quote 0
      • ustkU
        ustk
        last edited by ustk

        I use Sublime for Hise code search and mods, and to open, scroll and pick up code from sandbox projects.

        However I don't use external editor for the project itself and do everything inside Hise.
        The reason is that in the past when having files opened in both Hise and external editor, if you accidentally recompile Hise it overwrites your changes in the external editor (since the files are saving on recompile)

        This was before the new Hise script editor anyway so no need anymore
        Hise editor is now super powerful (minus just a few minor bugs). Having the double click on the API list to insert back would be awesome.

        Can't help pressing F5 in the forum...

        SimonS 1 Reply Last reply Reply Quote 1
        • SimonS
          Simon @ustk
          last edited by

          I'm trying to use Sublime text as the muscle memory is just too ingrained. Is there a quick way to get HISE to read the changes made by an external editor? I've been going File > Load XML every time.

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @Simon
            last edited by

            @Simon Learn to use the HISE scripting editor, it's the best workflow.

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            SimonS 1 Reply Last reply Reply Quote 0
            • SimonS
              Simon @d.healey
              last edited by

              I would really just prefer a way to use an external editor. After several weeks of intense scripting work using only the HISE editor, the low contrast color scheme, lack of syntax highlighting, lack of keyboard shortcuts, slower response time, and many other quirks make me far prefer the (sadly proprietary) Sublime text.

              I don't doubt that it will eventually be on par, but for the sake of getting work done I really need to be in Sublime at the moment. If the fastest way to reload the script is to load the xml I'll just keep doing that.

              d.healeyD 1 Reply Last reply Reply Quote 1
              • d.healeyD
                d.healey @Simon
                last edited by

                @Simon said in Using external Text Editor:

                lack of syntax highlighting, l

                It has syntax highlighting, which you won't get in Sublime because HISE script is not the same as Javascript. You'll also lose the autocomplete which is a great time saver.

                @Simon said in Using external Text Editor:

                lack of keyboard shortcuts

                Which are you missing?

                @Simon said in Using external Text Editor:

                many other quirks

                Yep it definitely has some quirks.

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

                oskarshO 1 Reply Last reply Reply Quote 1
                • oskarshO
                  oskarsh @d.healey
                  last edited by oskarsh

                  @d-healey I can just agree, yes you can input text into the hise script editor but this is where it ends.

                  The autocorrection often overrides the whole function and take me more time to fix it.
                  Autocorrection only works half the time.
                  Switching between files is painful
                  Editor gets very slow for long files
                  The search and replace never worked for me

                  but this is all ok and I can live with it.

                  also you can get syntax highlighting in Sublime as well as VSCode, VIM etc. there is a official standard for the language servers. I already started working on a prototype to migrate this :)

                  I think in general you should use the right tools for the job and not reinvent the wheel especially when it comes to text editing.

                  If there would only be a reload and recompile button it would make me 20% more effective when coding.

                  HISE Developer for hire :)

                  d.healeyD 1 Reply Last reply Reply Quote 0
                  • d.healeyD
                    d.healey @oskarsh
                    last edited by d.healey

                    @oskarsh said in Using external Text Editor:

                    The autocorrection often overrides the whole function and take me more time to fix it.

                    There is no autocorrect - do you mean the autocomplete? It doesn't override, it pops up suggestions and lets you choose to insert the suggestion or not. I have the autopopup disabled so it only shows when I hit ESC.

                    @oskarsh said in Using external Text Editor:

                    Switching between files is painful

                    If you're on Windows I believe you can use the back/forward mouse buttons to change file. But yeah it's not the best experience and the long standing tab issue still persists.

                    @oskarsh said in Using external Text Editor:

                    Editor gets very slow for long files

                    The only time I experienced this was when I was using arrays for SVG data which takes a lot of lines. But since I switched to encoded strings I haven't ran into it. I would suggest that if your scripts are so long that the editor is slowing down then your code needs to be broken into smaller parts anyway. But yeah lag is never good.

                    @oskarsh said in Using external Text Editor:

                    The search and replace never worked for me

                    Yeah I don't use it either, I use the find all occurrences though. If I need to do a batch search/replace then I use Ctrl+D to select each occurrence. Sometimes though I will go to an external editor if I need to replace things across multiple files.

                    @oskarsh said in Using external Text Editor:

                    I already started working on a prototype to migrate this

                    You're making one for HISE script?

                    Libre Wave - Freedom respecting instruments and effects
                    My Patreon - HISE tutorials
                    YouTube Channel - Public HISE tutorials

                    SimonS 1 Reply Last reply Reply Quote 0
                    • SimonS
                      Simon @d.healey
                      last edited by Simon

                      I didn't want to turn this thread into a wishlist for the HISE code editor, especially as I wanted to contribute fixes for some of these once I finish this library, but since we went there anyway...

                      For me the main issue is the low contrast, both just the color palette and lack of differentiation between functions, parameters, variables, control statements, and operators. I realize now looking at screenshots that the whole interface is blue tinted as well.

                      Sublime Text set to Javascript is quite usable, I haven't really compared with this. The bracket and parenthesis highlighting is far more visible in Sublime, and highlights from either side of the character. In HISE you have to put the cursor after the character, and the highlight is barely visible.

                      9cf67100-41c1-46b1-968c-a732c3d80c36-image.png 0b2e27ef-80bf-4908-a445-097787273776-image.png

                      When typing (, HISE sometimes inserts () when it's not helpful to do so. Haven't quite figured out the logic, but I run into it a lot.
                      4026c85d-e828-4301-922d-c24e60d99b19-output.gif

                      Sublime includes autocomplete for structures like, if, if else, for, which I use far more often than the API autocomplete and are huge time savers.4da3621e-651e-4af9-a96e-1f7b329166b0-for.gif

                      Usually if I'm looking in the API for a function I also need to browse the docs anyway. Sublime also autocompletes functions you have used already, the only thing missing is that tab to next parameter, the highlight state for which I find difficult to distinguish from the usual text selection highlight. This makes me not use it much.

                      In one of these screenshots, typing appends to the end. In the other, it clears and overwrites.

                      378d02b3-5d4d-490c-ad4e-500ce20169e1-Screenshot From 2024-12-18 15-46-27.png
                      c8b0536c-4215-4927-99a2-239efe52f159-Screenshot From 2024-12-18 15-46-12.png

                      I use ctrl + left and right arrow a lot to jump through functions. In Sublime one press usually takes you to the next token, in HISE it takes you to the next token or separator, which takes longer and usually isn't what I want.

                      4ae38562-3a87-492c-b610-c84690443d8f-HISE.gif
                      72ebe4ee-ce14-4d3b-ab49-1d82f08f0eb0-sublime.gif

                      For keybindings, in Sublime I also have bindings for things like go to next sub-token in a string.

                      For search, in HISE it defaults to case sensitive every time it's run, and pressing ctrl+f sometimes does not highlight the search field if a search is already open (can't quite track this down atm)

                      I use code folding quite a lot, which makes it much easier to jump between files without losing my place.

                      In short, I really just prefer using an external editor, especially as I assume a "reload from file" button would be less work to implement than maintaining a code editor and all the edge cases and user preferences that can go along with that.

                      d.healeyD D 2 Replies Last reply Reply Quote 0
                      • d.healeyD
                        d.healey @Simon
                        last edited by

                        @Simon said in Using external Text Editor:

                        When typing (, HISE sometimes inserts ()

                        Yeah that one gets me, same goes for square brackets, sometimes you want it, sometimes you don't.

                        @Simon said in Using external Text Editor:

                        Sublime includes autocomplete for structures like, if, if else, for,

                        HISE has it for loops, not sure I'd find it that helpful for if statements though.

                        Peek 2024-12-18 14-21.gif

                        @Simon said in Using external Text Editor:

                        use code folding quite a lot

                        HISE has code folding.

                        Libre Wave - Freedom respecting instruments and effects
                        My Patreon - HISE tutorials
                        YouTube Channel - Public HISE tutorials

                        SimonS 1 Reply Last reply Reply Quote 0
                        • SimonS
                          Simon @d.healey
                          last edited by

                          @d-healey I actually did not realize HISE had it for loops, would be nice if it appeared without pressing escape and with the same fluidity as in Sublime. The autocomplete in Sublime feels goood, it's instantaneous as you type. I'm not sure if the delay in HISE is intentional, maybe that's something we can tweak.

                          In Sublime you can code fold any line based on indentation. I use this quite a lot for folding away control declarations under a comment.

                          d.healeyD 1 Reply Last reply Reply Quote 0
                          • d.healeyD
                            d.healey @Simon
                            last edited by d.healey

                            @Simon said in Using external Text Editor:

                            would be nice if it appeared without pressing escape

                            It does. Right click and enable Autoshow Autocomplete (this is enabled by default).

                            @Simon said in Using external Text Editor:

                            In Sublime you can code fold any line based on indentation. I use this quite a lot for folding away control declarations under a comment.

                            When writing KSP I'd use code folding all the time. I pretty much never need it now because HISE scripts are generally so short. It's very rare I have a single script that is more than 500 lines (laf heavy scripts being a notable exception).

                            Do you use the code editor bookmarks in HISE? I find those make it really easy to navigate longer scripts.

                            Libre Wave - Freedom respecting instruments and effects
                            My Patreon - HISE tutorials
                            YouTube Channel - Public HISE tutorials

                            SimonS 1 Reply Last reply Reply Quote 0
                            • D
                              dxmachina @Simon
                              last edited by dxmachina

                              I strongly agree that there should be a little better support for external editors. Similar to @Simon and @oskarsh I have really fought the built in editor when it comes to just getting code written. I seem to gravitate back to the built in when debugging and working in UI.

                              The auto-autocomplete is also extremely unreliable for me. It feels like it stops working completely pretty often.

                              Honestly, being able to avoid overwrite-on-compile and watching for script changes / auto compile would be enough for me. The regular JS syntax highlighting in Sublime, Atom, VS Code are all much better for me but could easily be community addressed if someone wanted something more robust.

                              1 Reply Last reply Reply Quote 2
                              • SimonS
                                Simon @d.healey
                                last edited by

                                @d-healey I posted that comment because (in my memory anyway) I typed for and nothing happened, which led me to believe it doesn't appear for "for". The delay in autocomplete makes me much less likely to use it, while I use the instant popup in Sublime all the time.

                                How you fold code is of course user preference. I would quite like to be able to fold each control declaration along with its settings, callback assignment, and callback function, so when I'm looking for a control I can get an overview of all of them, and jump straight to the one I need without ctrl + f or the re-contextualization of bookmarks.

                                d.healeyD 1 Reply Last reply Reply Quote 0
                                • d.healeyD
                                  d.healey @Simon
                                  last edited by

                                  @Simon said in Using external Text Editor:

                                  I can get an overview of all of them, and jump straight to the one I need without ctrl + f or the re-contextualization of bookmarks.

                                  Yeah this is what I use bookmarks for, middle click and there's a list of all components.

                                  Libre Wave - Freedom respecting instruments and effects
                                  My Patreon - HISE tutorials
                                  YouTube Channel - Public HISE tutorials

                                  1 Reply Last reply Reply Quote 0
                                  • clevername27C
                                    clevername27 @oskarsh
                                    last edited by clevername27

                                    @oskarsh Be aware that there are issues with using an external text editor—namely, that HISE will sometimes overwrite your original file. Usually, this happens when HISE opens the same file in HISE, like if you click on an error report in the Console. But sometimes it just happens. My workaround its to use an external editor that tells me when a file that it has open was overwritten by HISE, and gives me the option to reject HISE's changes, or keep my own. (Though HISE hasn't actually made any changes; it's simply overwritten my last changes in the external editor, though it's more nuanced than that, which is another of saying I'm too lazy to be more specific.) There was a bug about this which was fixed a while back, which improved the situation a lot. But problems remain, so be careful so you don't lose any code. I know @Christoph-Hart has put a lot of work into HISE's built-in editor, and after two years, I'm still finding about cool stuff in it that I wasn't aware of. If do decide to go with an external editor, I can send you my list of HISE Script keywords for your editor. (If you're using BBEdit, I went so far as creating a HISE Script language module.)

                                    oskarshO 1 Reply Last reply Reply Quote 0
                                    • oskarshO
                                      oskarsh @clevername27
                                      last edited by

                                      @clevername27 Yes I am aware that HISE will overwrite the changes. I am suggesting a button or just a function that we can bind to a shortcut "reload and compile" which basically uses the file on Disc and not from the memory.

                                      I believe this should be easy to implement since we already have Load XML which basically does the same, reload all scripts, xml and compile them.
                                      If we could only get a shortcut or button for this functionality...

                                      I think the HISE editor is great for what it is but it will always lack against other editors which main job is to edit text. I am a big fan of removing dependencies and having a editor which I can style, use plugins (heck even VIM bindings) and have a very reliable and fast editing experience would be my biggest Christmas wish.

                                      Many IDE's have moved away from this baked in editor style approach, just less dependencies and maintenance.

                                      @Christoph-Hart can you play Santa and look into this? Mainly just a "reload and compile" function that we can bind to a shortcut?

                                      HISE Developer for hire :)

                                      clevername27C d.healeyD 3 Replies Last reply Reply Quote 1
                                      • clevername27C
                                        clevername27 @oskarsh
                                        last edited by

                                        @oskarsh I love your idea.

                                        1 Reply Last reply Reply Quote 0
                                        • d.healeyD
                                          d.healey @oskarsh
                                          last edited by

                                          @oskarsh said in Using external Text Editor:

                                          Mainly just a "reload and compile" function that we can bind to a shortcut?

                                          I think a file watcher would be better, no need to hit a button manually. Just save the external file and the changes will be there in HISE.

                                          Libre Wave - Freedom respecting instruments and effects
                                          My Patreon - HISE tutorials
                                          YouTube Channel - Public HISE tutorials

                                          clevername27C oskarshO ustkU 3 Replies Last reply Reply Quote 3
                                          • clevername27C
                                            clevername27 @d.healey
                                            last edited by

                                            @d-healey I love that idea, too.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            17

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.3k

                                            Posts