Closed l-ehlers closed 10 months ago
Hello. Thank you for posting the issue. I think you have met the following IDE built in feature -- Autosave files. It can be triggered by different events (for example, opening the terminal). If you open the terminal, files are saved and the jsonnet renderer sees the changes.
Could you confirm that you have 2 opened files at the same time, did the changes in the first file and then rendering the second file?
I think that it is possible to save all opened document before rendering and then render it. Let me see what I can do her.
Also, I have question about jrsonnet. Do you use jrsonnet features that do not exist in other implementations? I mean these https://github.com/CertainLach/jrsonnet/blob/master/docs/features.md
Hello @movatechtoday, thanks for your response!
I did have both A.jsonnet
and B.jsonnet
open at the same time. Then I have changed the contents of A.jsonnet
, switched to B.jsonnet
and pressed the space bar somewhere to trigger a new preview render.
You seem to be right about the autosaving (which surprises me because I thought Intellij IDEA would always autosave). I have just found the simple workaround to render correct previews: Ctrl+S
before triggering a new preview rendering.
However, it would be great if this would be a built-in feature of Jsonnet Pro. Thanks in advance!
No, we are trying to avoid using implementation-specific Jsonnet features.
Hello.
I have added 2 new options that affect rendering of jsonnet files.
You can enabled these flags in the Settings -> Tools -> Jsonnet -> AutoPreview
section
At the moment options are disabled. In the next release I am going to enable it. Testing shows the features are stable.
I would appreciate if you test it.
We were able to reproduce the following issue quite reliably in different development environments:
When using jrsonnet or go-jsonnet as Jsonnet executable in Jsonnet Pro, imported files are imported in an outdated state when rendering through the Jsonnet Pro "Auto Preview" (examples below). This corrupted state can be fixed by executing jsonnet in the shell and then rerendering the file in the Jsonnet Pro "Auto Preview".
Since the issue can be fixed by executing jsonnet in the shell, we assume that Jsonnet Pro performs some caching or similar, which is not correctly invalidated on file changes.
BEFORE
CORRUPT STATE
AFTER EXECUTING JSONNET FROM THE SHELL