Internal IDE error right after updating my plugin to latest version
Recently I've released the 0.2.2 version of my plugin https://plugins.jetbrains.com/plugin/17037-awk-support to the marketplace.
This is a custom language support plugin.
Then I noticed that when I asked IDEA to check for updates and installed the new version - it immediately shown the internal IDE error.
Some notable parts of the error text are:
Caused by: com.intellij.diagnostic.ImplementationConflictException: Language with ID 'AWK' is already registered: class intellij_awk.AwkLanguage
...
java.lang.RuntimeException: java.util.concurrent.ExecutionException: com.intellij.diagnostic.PluginException: Cannot create class intellij_awk.AwkParserDefinition
...
java.lang.IllegalStateException: Index is not created for `Stubs`
The complete file with exceptions is here https://github.com/xonixx/intellij-awk/files/7267655/err.txt
Then IDEA just disables the plugin.
Manual restart of IDEA and enabling back the plugin makes the new version work just fine.
What I also noticed that IDEA didn't ask for restart after plugin update, so I assume what happens is a conflict in existing active version of plugin with the one being installed.
I'm frustrated by this problem since it's bad user experience for final plugin users and I don't see an obvious way to test for this issue before the release. Could it be that I should somehow force the IDEA restart after my plugin updated? Could it be something related to the newest version of IDEA? - I didn't have this issue with past updates of my plugin.
I'm using:
IntelliJ IDEA 2021.2.2 (Ultimate Edition)
Build #IU-212.5284.40, built on September 14, 2021
Would be grateful for any advice to fix and prevent this problem for future releases of my plugin.
请先登录再写评论。
please don't crosspost between issue tracker and here
Sure, my bad. Initially I posted here since I was almost sure it's problem with my plugin and I'm doing something wrong.
Then after some additional thinking I though this might be Idea bug, thus posted the bug report.
Please feel free to delete one of my posts.
Thank you.
No problem. For reference, https://youtrack.jetbrains.com/issue/IDEA-279479
I'm planning to release new version of plugin soon. Is there any way I can prevent this issue from happenning this time?
For example, what is the way to tell IDEA that my plugin needs a restart after an update? Is there some setting in plugin.xml for this?
https://plugins.jetbrains.com/docs/intellij/dynamic-plugins.html
Try setting
require-restart="true"though AFAIU there might be problem with IDE taking that into account 100% (known bug)