Fix meerkat compatibility#20
Merged
Merged
Conversation
Qodana Community for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2024.2.5
with:
upload-result: trueContact Qodana teamContact us at qodana-support@jetbrains.com
|
There was a problem hiding this comment.
Pull Request Overview
This pull request fixes the compatibility issue by preventing PSI element access on the EDT and ensuring actions run on the background thread. Key changes include:
- Updating the getMinSdkVersion function to use the nonBlocking ReadAction with a Project parameter.
- Overriding getActionUpdateThread in ImportAction to return ActionUpdateThread.BGT.
- Updating the CHANGELOG to document these changes.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/main/kotlin/com/abeade/plugin/figma/utils/AnActionEventExtensions.kt | Updated getMinSdkVersion to use nonBlocking ReadAction and include a Project parameter. |
| src/main/kotlin/com/abeade/plugin/figma/ImportAction.kt | Added getActionUpdateThread override and refactored PSI element handling in update(). |
| CHANGELOG.md | Recorded changes for Meerkat compatibility and API usage updates. |
Files not reviewed (1)
- gradle.properties: Language not supported
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes error:
This error is caused by accessing PSI (Program Structure Interface) elements on the EDT (Event Dispatch Thread), which is not allowed in recent versions of IntelliJ Platform-based IDEs like Android Studio. The platform enforces this to avoid performance and UI freezing issues.
This PR is using
ActionUpdateThread.BGTby overridinggetActionUpdateThreadmethod in theImportAction.Also replaces the usage of the deprecated API
DumbService.getInstance(project).runReadActionInSmartModeby usingReadAction.nonBlocking<T> { }.inSmartMode(project)instead.closes #19