Continuous commands, such as "Show parsed AST (continuous)" stop updating for dynamically loaded languages after reloading the language. This is annoying, because most of the time we want to check the result of a continuous command after rebuilding a language.
What you did
Run a continuous debugging command, change and rebuild the language.
What you expected to happen
The command to run and show new feedback after rebuilding the language.
What actually happened
The command is not updated any more, until it is initiated again.
Context
Spoofax version: 0.12.0
Operating system & version: Any
Additional information
The continuous command is initially observed in the PIE instance of the dynamically loaded language. After rebuilding the language, if the PIE store of that dynamically loaded language is thrown away, the task does not exist any more and hence it is not re-executed.
If we serialize the PIE store of the language on unload, and deserialize it again on reload, the task does still exist and is still observed. However, to re-execute all affected tasks (including continuous commands), we must run a bottom-up build on the PIE instance of the language after reloading it, with the resources that were provided during the build of that language. The DynamicLoadingTest does this, and this should be implemented in the Eclipse LWB plugin as well.
Two problems were uncovered while implementing this:
[x] When a language is dynamically reloaded, the PIE instance is recreated. When it is recreated, its callbacks are lost, and thus even though the task of a continuous command is re-executed, there is no callback to inform the IDE of the new feedback. Therefore, the editor with feedback is not updated.
[x] Certain language tasks require their definition files. For example, the parse task of a language requires its parse table, such that it is re-executed when the parse table changes. However, this dependency is made to the local file of that definition resource. The problem is that in Eclipse, we use Eclipse resources, and these do not match the local file requirements. For example, when an SDF3 file of the language is changed, and thus the parse table of the language is updated, the Eclipse resource of that parse table is provided, while the parse task requires it as a local resource. Therefore, changes to the parse table do not trigger re-execution of parse tasks. The same problem exists with other tasks as well.
Summary
Continuous commands, such as "Show parsed AST (continuous)" stop updating for dynamically loaded languages after reloading the language. This is annoying, because most of the time we want to check the result of a continuous command after rebuilding a language.
What you did
Run a continuous debugging command, change and rebuild the language.
What you expected to happen
The command to run and show new feedback after rebuilding the language.
What actually happened
The command is not updated any more, until it is initiated again.
Context
Additional information
The continuous command is initially observed in the PIE instance of the dynamically loaded language. After rebuilding the language, if the PIE store of that dynamically loaded language is thrown away, the task does not exist any more and hence it is not re-executed.
If we serialize the PIE store of the language on unload, and deserialize it again on reload, the task does still exist and is still observed. However, to re-execute all affected tasks (including continuous commands), we must run a bottom-up build on the PIE instance of the language after reloading it, with the resources that were provided during the build of that language. The
DynamicLoadingTest
does this, and this should be implemented in the Eclipse LWB plugin as well.