plugin action works on mac, but don't work on win

Answered

Hi, I'm having some problems while developing a plugin for Goland using idea. After my plug-in is packaged, it can run well on MacOS, but it can't work on Windows computer. I can't find my plug-in in EditorPopupMenu. Here are some details of my local development environment.

Some details:

  • idea:IntelliJ IDEA 2022.1 (Ultimate Edition)
  • Goland:GoLand 2022.1
  • JDK:azul-11(java-version11.0.15)
  • MacOS:Montetry 12.2.1.

The screenshot shows my plugin.xml and Action class files

8 comments
Comment actions Permalink

I'm a novice in plugin development, I really hope to get help from everyone

0
Comment actions Permalink

Hi,

Could you please provide us with more details? Is there any exception in the logs when running it on Windows?

Are the plugin sources publicly available?

1
Comment actions Permalink

What do you mean by re-registering an action? What do you mean by writing subsequent code? Could you please describe the steps to reproduce in detail? Also, please share the test project we can reproduce it in, so we don't have to create and set up it manually.

Also, it is not possible to help you without the source code. I understand your plugin is not open source and you don't want to share it publicly. Consider uploading it to https://uploads.jetbrains.com/ and sharing the Upload ID here. It will be visible only to JetBrains employees.

0
Comment actions Permalink

I'm sorry that I forgot to upload the source code repository because I didn't think about it carefully. I have now uploaded the latest local source code in the link you provided! Hope to get your help.

0
Comment actions Permalink

Please share the Upload ID, so I can find the files you uploaded 🙂

0
Comment actions Permalink

Upload id: 2022_05_24_W5U8BM2HeXdomjjf (file: ThriftHelper.zip)

0
Comment actions Permalink

Hi,

It's hard to say if it is the issue cause but your update() method implementation seems to break its documented rules, especially:

This method can be called frequently, and on UI thread. This means that this method is supposed to work really fast, no real work should be done at this phase. For example, checking selection in a tree or a list, is considered valid, but working with a file system or PSI (especially resolve) is not. If you cannot determine the state of the action fast enough, you should do it in the actionPerformed(AnActionEvent) method and notify the user that action cannot be executed if it's the case.

Your update() method does the actual work - it generates some code and maybe it is slow on Windows for some reason. I don't see any other errors in implementing and registering the action.

PS
Please share the full action code next time. If you shared this method on the screen, we would avoid wasting time on sharing and running the project. It wasn't obvious that you even implemented update() method and it turns out to be probably the issue cause, so the most important part was omitted.

0
Comment actions Permalink

Thank you for your suggestion, and I am very sorry to waste your precious time because of my ill-consideration. Thanks a lot for your help!

0

Please sign in to leave a comment.