Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why is merge request needed
We are now focusing on refactoring the TestSpark codebase for improving its readability and maintainability. This PR introduces minor refactors through the entire codebase that don't fall into a category of a specific project module.
Description of changes made
Move class-level fields in TestSparkAction to actionPerformed. Because this may lead to resource leaks. Closes
AnAction
must not contain data fields according to documentation #242Extract the TestSparkActionWindow class into a separate file for better modularity and maintainability. This separation improves code readability and simplifies the structure of TestSparkAction by isolating UI logic. It will also reduce potential git conflicts.
Add
.intelliJPlatform
folder to.gitignore
because it's a local build folder and shouldn't be pushed anywhere. We have many git unresolved files displaying in IntelliJ and it's quite annoying.Remove the irrelevant TODO in TestSparkActionWindow.kt
If the psiHelper is not available, we'll get a NullPointerException automatically, so we don't need to throw anything manually. It's the responsibility of the caller class to make sure that the window is shown only when the dataContext returns some data and a psiHelper instance can be retrieved.
Refactor
TestCompilerFactory
to close issue Add the warning window that for Java we always need the javaHomeDirectoryPath in the TestCompilerFactory #324. Use the provided javaSDKHomePath or derive it from the project's instance. If can't derive throw an exception. At the moment we never passjavaSDKHomePath
explicitly in the project so it shouldn't break anything either.Resolve some IDE warnings. Remove redundant qualifier names in
TestSparkAction.kt
I have checked that I am merging into correct branch