Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

abiharbani
Copy link
Contributor

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.

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.
@abiharbani abiharbani requested a review from a team as a code owner July 3, 2024 00:14
@@ -150,6 +150,7 @@ private void setFile(@Nullable PsiFile psiFile) {
mainPanel.remove(previewComponent);
previewComponent = null;
}
weavePreviewComponent = new WeavePreviewComponent(myProject);
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link

salesforce-cla bot commented Jul 3, 2024

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
@abiharbani abiharbani force-pushed the ah_fixWeavePreviewCannotOpen branch from d4b576e to 0d03c44 Compare July 3, 2024 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants