Code Monkey home page Code Monkey logo

Comments (9)

duemir avatar duemir commented on June 15, 2024

It requires a newer IntelliJ baseline. com.intellij.fileTypeFactory was deprecated in 2019.2.

from idea-stapler-plugin.

duemir avatar duemir commented on June 15, 2024

Registering a File Type | IntelliJ Platform Plugin SDK

from idea-stapler-plugin.

jgreffe avatar jgreffe commented on June 15, 2024

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 (?)
Monosnap hacktoberfest – plugin xml (Stapler plugin for IntelliJ IDEA) 2022-11-02 09-21-48

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 :/

from idea-stapler-plugin.

duemir avatar duemir commented on June 15, 2024

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.

from idea-stapler-plugin.

duemir avatar duemir commented on June 15, 2024

I don't know how much of a clue it is, but when I updated the plugin in IntelliJ Community Edition, dynamic reload worked.

from idea-stapler-plugin.

jgreffe avatar jgreffe commented on June 15, 2024

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:

  • change Registry... configuration with ide.plugins.snapshot.on.unload.fail to true
  • open a jelly file

In another terminal:

$ gradle buildPlugin -xbuildSearchableOptions

Switch focus back to sandbox:

  • plugin will try to reload dynamically
  • a popin will show stating dynamic reload failed
  • look at 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>
* com.intellij.ide.plugins.cl.PluginClassLoader


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

from idea-stapler-plugin.

duemir avatar duemir commented on June 15, 2024

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.

from idea-stapler-plugin.

jgreffe avatar jgreffe commented on June 15, 2024

Same issue with standard simple language demo from JetBrains.
Created https://youtrack.jetbrains.com/issue/IDEA-305958/simplelanguageplugin-not-dynamic

from idea-stapler-plugin.

jgreffe avatar jgreffe commented on June 15, 2024

Created issue is a duplicate of https://youtrack.jetbrains.com/issue/IDEA-263300 (unresolved yet)

from idea-stapler-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.