Actual Parameter Updates in Both Original and Cross-Referencing Documents in Langium #1818
Unanswered
Subham7201
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Hey @Subham7201,
You are probably using |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
DSL Definition for Call Expression and Actual Parameter
Objective
Approach Taken
We trigger an event handler from the frontend, which initiates an update call followed by a save call to the backend.
In the update call, we attach a listener to the build phase of the Langium document, which triggers validation within our program.
This validation filters all documents that reference the original document. We then iterate through each of these cross-referencing documents, identify those containing diagnostics, and add the newly introduced actual parameter to them.
Once this process is complete, we attempt to send the URI of the original document to the frontend. The frontend uses this URI to trigger a save operation, ensuring that the actual parameter is added to the original document, thus completing the update in both the original and cross-referencing documents.
Issue Encountered
Since the listener is attached to the Langium document’s build phase, all cross-referencing documents are updated within the same update call.
However, because the listener execution modifies multiple documents, the original document's URI is not properly sent to the frontend.
As a result, while the actual parameter is successfully added to all cross-referencing documents, the update to the original document does not occur.
Since the validation has already run, the parameter is not processed again for the original document, leaving it unchanged.
Possible Solution
What could be the possible solution for this problem?
Beta Was this translation helpful? Give feedback.
All reactions