QReserve comes with a built-in IDE for the sneq language. It is accessible when editing scripts.
When writing code in the IDE, it will automatically be parsed for correctness and syntax highlighted. Any parsing errors will result in the invalid syntax being highlighted and an icon being placed beside it. To see the parsing error, mouse over the icon.
Once your script parses successfully, you will be able to click the Save button. After saving, you can test out the script by clicking Test Reservation or Request.
The testing modal is similar to the calendar or request booking modal, but has a few differences. One is that you can not book any actual reservations or requests through this modal. Instead, it helps you see whether or not your script allows the user to be able to book or advance by observing the "Can Progress" variable under Script Testing Debug States.
It allows one to manually trigger both conflict tests and conflict tests with scripts by clicking the buttons on the bottom right. The Trigger Conflict Check With Forms button will send the forms to the backend when testing, something normally only done when a reservation has been completed. This will allow you to observe any conflicts that may result from parsing and evaluating form responses.
There is also a selector for the Logged in user. This only affects the perspective of the script being run, not the rest reservation or request being made. To set the perspective of the rest of the modal itself to be that of an administrator or site user, use the Enable administrator overrides toggle in the top right of the modal.
When testing, your script may crash. Crashes are caught in the IDE and displayed to the user. Like parsing errors, the offending code is highlighted and you can get more information about the crash by mousing over the icon. More helpful information is contained within the box labeled Oops! Your script crashed, which can be expanded by clicking on it.
The expanded error will have a detailed stack trace and highlights exactly where your script ran into problems. For reference, the immutable context and the variables in the scope of each function are also given to help troubleshoot where the script failed.
When you've corrected your script, click Clear Script Errors to clear out the clear out all the stored errors. Then save and try your script again until it appears to be bug-free.
It is sometimes the case that your script crashes when your users are executing it. Your users will see a generic error in this case, and will be blocked from booking. Stack traces and contextual information about these errors is stored as JSON in your audit log. In the future, you will be able to review these stack traces on the editing page so that you can correct your scripts.