Closing the GUI window spawned from VDM will crash the server
Happened in the project https://github.com/jonaskrask/vdm-vscode/tree/development/resources/examples/VDMSL/ConwayGameLifeSL
When I run using the last launch configuration ("Launch ConwayGameLifeSL Debug 4") the server crash if you close the window that is opened, even if you wait till the debug session is over.
Related to #76
Looks like this one has inherited a different Java class to the one I know - this model was tinkered with by the Overture folk.
The situation with VSCode is that the native "GUI" runs in the same process as the LSP Server, so if you kill it, perhaps by setting an "exit on close" flag for the GUI, then that kills the server. The version of the class I have cleans itself up when you close the GUI and disposes of its resources, but doesn't exit the process.
If I send updated Java source and jar, can you try those?
I already added that jar to illustrate "remote control" (located in lib/gui_remote.jar). If I only use your jar the following functions in Graphics.vdmsl will not work (meaning the Debug 4 launch configuration does not work).
initialise: nat1 * nat1 -> int
initialise(gridSideCount, sleepTime)== is not yet specified;
newLivingCell: int * int -> int
newLivingCell(x,y)== is not yet specified;
newRound: () -> int
newRound()== is not yet specified;
Should we just remove that code and the launch configuration and stick to the remote control? Or do you have a better idea?
Yes, if their "improved" Conway example isn't really adding anything over the one we're using for remote control, perhaps it's easiest to drop the example that fails.
Apart from the GUI being launched from the spec and not the other way around I don't think it adds anything, but not sure.
@idhugoid do you know if there is an important difference between the two Conway versions?
This is probably the wrong approach, but how hard would it be for the Client to check when a launch has a "remoteControl", and if so, check whether the Server has stopped afterwards? It could then restart it, on the basis that the user code must be at fault - perhaps with an ugly notification, saying "Your remote control class terminated abnormally".
Hmm.. I will see if something like this is doable