metaborg / spoofax-pie

Spoofax implementation using PIE pipelines
Apache License 2.0
12 stars 9 forks source link

Continuous commands stop updating for dynamically loaded languages after rebuilding/reloading the language #63

Closed Gohla closed 3 years ago

Gohla commented 3 years ago

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.

Gohla commented 3 years ago

Two problems were uncovered while implementing this:

Gohla commented 3 years ago

Fixed by https://github.com/metaborg/spoofax-pie/commit/881f8668fa9fb12e7810b43b1a735750385381ec