如何触发IntelliJ Idea CE 2020.1 build 201.6668.60中插件的自动重新加载。

huangapple go评论92阅读模式
英文:

How do you trigger auto reloading of plugins in Intellij Idea CE 2020.1 build 201.6668.60

问题

以下是您要翻译的内容:

我有一个简单的IntelliJ平台插件项目,在构建或启用/禁用后似乎无法正确重新加载。需要哪些步骤来触发重新加载?

这里是我所指的情况的视频

这是我的插件代码

package benconvey.adaideplugin.actions;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import org.jetbrains.annotations.NotNull;

public class BensAction extends AnAction {

    @Override
    public void actionPerformed(@NotNull AnActionEvent event) {

        Project currentProject = event.getProject();
        Messages.showMessageDialog(currentProject, "Hello", "Say Hello", Messages.getInformationIcon());
    }

}
<idea-plugin>
    <id>org.example.testing</id>
    <name>在此处插件显示名称</name>
    <vendor email="support@yourcompany.com" url="http://www.yourcompany.com">YourCompany</vendor>

    <description><![CDATA[
    在这里输入插件的简短描述。<br>
    <em>可以使用大多数HTML标签</em>
    ]]></description>

    <!-- 请参阅 https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
         了解如何针对不同的产品进行定位 -->
    <depends>com.intellij.modules.platform</depends>

    <extensions defaultExtensionNs="com.intellij">
        <!-- 在这里添加您的扩展 -->
    </extensions>

    <actions>
        <action id="benconvey.adaideplugin.actions.BensAction" class="benconvey.adaideplugin.actions.BensAction"
                text="Say Hello">
            <add-to-group group-id="EditMenu" anchor="first"/>
        </action>
    </actions>
</idea-plugin>
英文:

I have a simple intellij platform plugin project that doesn't seem to reload properly after I build or enable / disable it. What steps are needed to tigger the reloading?

Here's a video of what I mean

Here's my plugin code

package benconvey.adaideplugin.actions;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import org.jetbrains.annotations.NotNull;

public class BensAction extends AnAction {

    @Override
    public void actionPerformed(@NotNull AnActionEvent event) {

        Project currentProject = event.getProject();
        Messages.showMessageDialog(currentProject, &quot;Hello&quot;, &quot;Say Hello&quot;, Messages.getInformationIcon());
    }

}
&lt;idea-plugin&gt;
    &lt;id&gt;org.example.testing&lt;/id&gt;
    &lt;name&gt;Plugin display name here&lt;/name&gt;
    &lt;vendor email=&quot;support@yourcompany.com&quot; url=&quot;http://www.yourcompany.com&quot;&gt;YourCompany&lt;/vendor&gt;

    &lt;description&gt;&lt;![CDATA[
    Enter short description for your plugin here.&lt;br&gt;
    &lt;em&gt;most HTML tags may be used&lt;/em&gt;
    ]]&gt;&lt;/description&gt;

    &lt;!-- please see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
         on how to target different products --&gt;
    &lt;depends&gt;com.intellij.modules.platform&lt;/depends&gt;

    &lt;extensions defaultExtensionNs=&quot;com.intellij&quot;&gt;
        &lt;!-- Add your extensions here --&gt;
    &lt;/extensions&gt;

    &lt;actions&gt;
        &lt;action id=&quot;benconvey.adaideplugin.actions.BensAction&quot; class=&quot;benconvey.adaideplugin.actions.BensAction&quot;
                text=&quot;Say Hello&quot;&gt;
            &lt;add-to-group group-id=&quot;EditMenu&quot; anchor=&quot;first&quot;/&gt;
        &lt;/action&gt;
    &lt;/actions&gt;
&lt;/idea-plugin&gt;

答案1

得分: 1

使用 "运行" | 重新加载更改的类 操作。有关更多上下文,请参阅重新加载修改后的类

英文:

Use Run | Reload Changed Classes action. See Reload modified classes for more context.

huangapple
  • 本文由 发表于 2020年4月8日 21:41:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/61102110.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定