Suggestion for improved IDE functionality

Posted on
  • I've been using my espruino for a few days now and have been really impressed. The experience has helped improve my JavaScript knowledge and I now really like the async nature of the language.

    Although it's great being able to just type a command into the console window and have it execute I tend to use the RHS of the IDE too much which is more like a traditional 'compiled' environment.

    It would be extremely useful if it was possible to send just the function currently being edited in the IDE to the console - this could call the 'edit' function and replace the existing function without resetting the running code (I realise the full outer function would probably need replaced).

    Another idea would be to highlight a section of code in the IDE and send it to the console where it would be executed.

    The IDE could possibly have a right click context menu with the options 'Replace current function' and 'Execute highlighted code'.

    Just a couple of ideas which may add to the USP of the espruino platform!

  • Thanks - that's actually a really neat idea. I'll add it to GitHub.

    I wonder whether it could actually just detect what changed since the last upload automatically, and just push that - although I guess it could be a bit tricky.

    Changing file-level functions should be pretty easy to implement, although I'm afraid that replacing functions inside other functions could end up being a bit difficult.

    In the mean time, you could:

    • Just copy/paste - but I guess you already do this?
    • Uncheck reset before send in the Settings menu. This will still re-send everything, but won't reset your device. It means that if you put your initialisation code in onInit(), you will effectively get all your functions updated without having to reset the device.
  • Hot swap is a tricky thing... ensuring consistency after any edit is practically impossible, especially when going very optimized/minified. It is not impossible, but the limited amount of memory makes it even more difficult. Yes, the Laptop / Web IDE could be aware of all what is on the board... it it should not be memory strapped...

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Suggestion for improved IDE functionality

Posted by Avatar for DaveNI @DaveNI

Actions