2 hours ago, androidi wrote
@magicalclick: "I don't like the idea that" Well it can be something you can a) turn on b) if on, the ide could have option to pop up a dialog before you can start writing a comment (recall, you can't make any changes outside comments in what I suggested). c) any edits made at run-time that are not comment would be reverted or turned into comments.. (eg. inserting single / between 1234 would turn that to 12/34 which is not a comment - either this type of edit could be disallowed entirely by default or the IDE could ask if you want to insert the //#/ /#// around that code and background compile it after which you could do instant "pause,apply edit and continue" w/o pausing the app for more than milliseconds. If you stopped the app the original code would be preserved while the modified line code could be copied to be inside regular comment or discarded depending on preference)
@magicalclick: "You can always make a quick garbage loop above your breakpoint during the pause. "
As explained in other other thread, if you were modifying say audio code, you'd only have the audio buffer amount of time to apply the edit without glitching the audio. The system suggested here would enable that scenario 'simply' by making intellisense/background compiler & editor available while app is running. Then use edit & continue to instantly apply to changes or if the changes can't be applied with e&c then opt to restart the app & either keep the changes commented or merge them and restart.
"impossible for the IDE to know whether you're editing comment or code unless they're stored in different places" .. "removed the "//" marking"
The rules to answer that could be, while running:
1. every new line with text must start with comment character. /
2. Edits are also allowed inside existing comments
3. If attempting to remove comment /'s from something starting with //#/ (indicating code inside comment) while running, either IDE can stop you or it can ask analyze the code for whether it can be inserted through pausing the app/thread and using edit & continue to insert the uncommented code.
"it's about the compiler only recognise changes in source file by filesize and modified time changes"
Depending on the technical requirements here's couple approaches:
1) If it's that you don't want the run-time-edit to modify the timestamp until app is paused and saved: The source file can be made such that other apps cannot write to it (share read only), then you can store the runtime changes elsewhere and merge them during pause/restart/stop debug.
2) If it is that you want the timestamp to change: don't allow saving the run-time-edit untl //#/ is met with /#// (end commented code tag).
The background compiler can be called to detect if the code is valid prior to attempting to save it.
3) You could treat the changes made at runtime as if you were doing stuff in the
a) repl loop/immediate window or
b) doing inmemory copy of the source and doing compile using inmemory virtual filesystem.
c) Or store the changes in some OS database after removing share-write flag from the source file, then when the background compiler is going through the source, it add the runtime modified pieces from the db.