Open duemir opened 3 years ago
It requires a newer IntelliJ baseline. com.intellij.fileTypeFactory
was deprecated in 2019.2.
Hello @duemir ,
with last master
, I tried following this: https://plugins.jetbrains.com/docs/intellij/dynamic-plugins.html#restrictions
But IDEA states nothing to report (?)
And running locally:
$ gradle runPluginVerifier -PideaVersion=2022.2.3
...
Plugin Stapler plugin for IntelliJ IDEA:2.1.0 against IC-222.4345.14: Compatible
Plugin can probably be enabled or disabled without IDE restart
Plugin Stapler plugin for IntelliJ IDEA:2.1.0 against IC-223.6160.11: Compatible
Plugin can probably be enabled or disabled without IDE restart
...
But it seems it's still not dynamic, as when installed, trying to uninstall -> requires IDE restart :/
Check https://plugins.jetbrains.com/docs/intellij/dynamic-plugins.html#code
Do not store references to PSI elements in objects which can survive plugin loading or unloading; use
SmartPsiElementPointer
instead.
A bunch of XmlTag-s and XmlAttributes are stored around directly, I believe. Something to look into as far as this feature goes.
I don't know how much of a clue it is, but when I updated the plugin in IntelliJ Community Edition, dynamic reload worked.
I'm my side, can't make it reload dynamically :/ In a terminal:
$ gradle runIde -PrunIde.jvmArgs+="-XX:+UnlockDiagnosticVMOptions" -PideaVersion=2022.1
In the opened sandbox:
Registry...
configuration with ide.plugins.snapshot.on.unload.fail
to true
In another terminal:
$ gradle buildPlugin -xbuildSearchableOptions
Switch focus back to sandbox:
build/idea-sandbox/system/log/idea.log
:
2022-11-07 08:41:28,176 [ 44771] INFO - #c.i.i.p.DynamicPlugins - Snapshot analysis result: Root 1:
ROOT: Global JNI
com.intellij.openapi.wm.impl.IdeFrameImpl.myFrameHelper
com.intellij.openapi.wm.impl.ProjectFrameHelper$1.this$0
com.intellij.openapi.wm.impl.ProjectFrameHelper.project
com.intellij.openapi.project.impl.ProjectExImpl.componentKeyToAdapter
java.util.concurrent.ConcurrentHashMap.table
java.util.concurrent.ConcurrentHashMap$Node[]
java.util.concurrent.ConcurrentHashMap$Node.val
com.intellij.serviceContainer.ServiceComponentAdapter.initializedInstance
com.intellij.ide.structureView.impl.StructureViewFactoryImpl.myImplExtensions
java.util.concurrent.ConcurrentHashMap.table
java.util.concurrent.ConcurrentHashMap$Node[]
java.util.concurrent.ConcurrentHashMap$Node.key
org.kohsuke.stapler.idea.psi.JellyFileImpl.<loader>
2022-11-07 08:41:28,213 [ 44808] INFO - #c.i.i.p.DynamicPlugins - Plugin Stapler plugin for IntelliJ IDEA is not unload-safe because class loader cannot be unloaded. Memory snapshot created at /Users/xxx/unload-Stapler plugin for IntelliJ IDEA-07.11.2022_08.41.21.hprof
That looks like the new PSI class that you introduced, which appears to be used as a key in the map somewhere inside IntelliJ. Other than asking in Jetbrains Slack and reporting to their YouTrack if that's what they suggest on Slack, I have no ideas.
To be honest this is nice to have category in my head, so I personally would not be spending much time on this.
Same issue with standard simple language demo from JetBrains. Created https://youtrack.jetbrains.com/issue/IDEA-305958/simplelanguageplugin-not-dynamic
Created issue is a duplicate of https://youtrack.jetbrains.com/issue/IDEA-263300 (unresolved yet)
Dependencies
Blocked on IntellIJ upstream bug: https://youtrack.jetbrains.com/issue/IDEA-263300
Feature Request
According to https://plugins.jetbrains.com/plugin/1885-stapler-framework-support/versions following is what is blocking it: