-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed plugin crash and add libraries #117
base: master
Are you sure you want to change the base?
Fixed plugin crash and add libraries #117
Conversation
In the recent commit, there was a full dispose that caused the WeavePreviewComponent not being able to be reused. This causes plugin crash in the IDE when opening the Dataweave preview. The proposed solution is to recreate the WeavePreviewComponent when setting a new DWL file, because WeavePreviewComponent is always in a disposed state at this time. In a dataweave that has java import for classes that live in a library, the Dataweave preview complains that it cannot find the class file. The proposed solution is to send all libraries, except SDK, to the agent so that the class file is available when the script engine evaluates the Dataweave in the agent.
@@ -150,6 +150,7 @@ private void setFile(@Nullable PsiFile psiFile) { | |||
mainPanel.remove(previewComponent); | |||
previewComponent = null; | |||
} | |||
weavePreviewComponent = new WeavePreviewComponent(myProject); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we only re-created if it is disposed? Shouldn't we check that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll add a check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A check was added in the latest commit.
Thanks for the contribution! Unfortunately we can't verify the commit author(s): Abi Harbani <a***@g***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, sign the Salesforce Inc. Contributor License Agreement and this Pull Request will be revalidated. |
Perform an isDisposed check before recreating weavePreviewComponent
d4b576e
to
0d03c44
Compare
In a recent commit, there was a full dispose that caused the WeavePreviewComponent not being able to be reused. This causes plugin crash in the IDE when opening the Dataweave preview. The proposed solution is to recreate the WeavePreviewComponent when setting a new DWL file, because WeavePreviewComponent is always in a disposed state
at this time.
In a dataweave that has java import for classes that live in a library, the Dataweave preview complains that it cannot find the class file. The proposed solution is to send all libraries, except SDK, to the agent so that the class file is available when the script engine evaluates the Dataweave in the agent.