intellij-zig icon indicating copy to clipboard operation
intellij-zig copied to clipboard

`getId` deprecated - See `org.ziglang.execution.ZigRunConfigurationFactory`

Open koekiebox opened this issue 3 years ago • 4 comments

I got the following error while running IntelliJ IDEA v2021.3.2:

com.intellij.diagnostic.PluginException: The default implementation of method 'getId' is deprecated, you need to override it in 'class org.ziglang.execution.ZigRunConfigurationFactory'. The default implementation delegates to 'getName' which may be localized, but return value of this method must not depend on current localization. [Plugin: org.ziglang]
	at com.intellij.ide.plugins.PluginManagerCore.createPluginException(PluginManagerCore.java:290)
	at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:12)
	at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:83)
	at com.intellij.diagnostic.PluginException.reportDeprecatedDefault(PluginException.java:110)
	at com.intellij.execution.configurations.ConfigurationFactory.getId(ConfigurationFactory.java:75)
	at com.intellij.execution.impl.RunManagerImplKt.getFactoryKey(RunManagerImpl.kt:1374)
	at com.intellij.execution.impl.RunManagerImplKt.access$getFactoryKey(RunManagerImpl.kt:1)
	at com.intellij.execution.impl.RunManagerImpl.getConfigurationTemplate(RunManagerImpl.kt:333)
	at com.intellij.execution.impl.RunManagerImpl.createConfiguration(RunManagerImpl.kt:261)
	at com.intellij.execution.actions.RunConfigurationProducer.cloneTemplateConfigurationStatic(RunConfigurationProducer.java:259)
	at com.intellij.execution.actions.RunConfigurationProducer.cloneTemplateConfiguration(RunConfigurationProducer.java:249)
	at com.intellij.execution.actions.RunConfigurationProducer.createConfigurationFromContext(RunConfigurationProducer.java:98)
	at com.intellij.execution.actions.RunConfigurationProducer.findOrCreateConfigurationFromContext(RunConfigurationProducer.java:199)
	at com.intellij.execution.actions.PreferredProducerFind.doGetConfigurationsFromContext(PreferredProducerFind.java:110)
	at com.intellij.execution.actions.PreferredProducerFind.getConfigurationsFromContext(PreferredProducerFind.java:93)
	at com.intellij.execution.actions.ConfigurationContext.getConfigurationsFromContext(ConfigurationContext.java:414)
	at com.intellij.execution.actions.ConfigurationContext.findPreferredConfiguration(ConfigurationContext.java:292)
	at com.intellij.execution.actions.ConfigurationContext.findExisting(ConfigurationContext.java:285)
	at com.intellij.execution.actions.BaseRunConfigurationAction.findExisting(BaseRunConfigurationAction.java:62)
	at com.intellij.execution.actions.BaseRunConfigurationAction.fullUpdate(BaseRunConfigurationAction.java:232)
	at com.intellij.execution.actions.BaseRunConfigurationAction.update(BaseRunConfigurationAction.java:198)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performDumbAwareUpdate$0(ActionUtil.java:131)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:145)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.doUpdate(ActionUpdater.java:602)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$updateActionReal$7(ActionUpdater.java:126)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:170)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.updateActionReal(ActionUpdater.java:127)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$new$0(ActionUpdater.java:109)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.update(ActionUpdater.java:588)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:434)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$21(ActionUpdater.java:413)
	at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1454)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:413)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:489)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$21(ActionUpdater.java:413)
	at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1454)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:413)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:489)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$21(ActionUpdater.java:413)
	at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1454)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:413)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:489)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$21(ActionUpdater.java:413)
	at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1454)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:413)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:489)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$21(ActionUpdater.java:413)
	at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1454)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:413)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:489)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$21(ActionUpdater.java:413)
	at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1454)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:413)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroup(ActionUpdater.java:233)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$expandActionGroupAsync$13(ActionUpdater.java:286)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$expandActionGroupAsync$15(ActionUpdater.java:309)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1084)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$expandActionGroupAsync$16(ActionUpdater.java:309)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:158)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$expandActionGroupAsync$17(ActionUpdater.java:305)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:624)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
	at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:277)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$expandActionGroupAsync$18(ActionUpdater.java:304)
	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:246)
	at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:32)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:225)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:213)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:214)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:829)

koekiebox avatar Feb 16 '22 08:02 koekiebox

I know it's deprecated

ice1000 avatar Feb 16 '22 16:02 ice1000

I just lost interest in developing idea plugins. I think someone should take the code and make a better plugin.

ice1000 avatar Feb 16 '22 16:02 ice1000

Ok @ice1000 . I will do a merge request if you have the time to review and approve/merge? I have never done an IntelliJ plug-in and keen to try it out. Thank you!

koekiebox avatar Feb 16 '22 17:02 koekiebox

Ok @ice1000 . I will do a merge request if you have the time to review and approve/merge? I have never done an IntelliJ plug-in and keen to try it out. Thank you!

It is very hard to make IDEA plugins. Also, users won't be nice to you. They'll yell at you because of your free work. I've tasted that before.

My recommendation is: don't do it.

However, PRs are welcomed. Go for it, and I'll review. I expect a few lines of changes.

ice1000 avatar Feb 16 '22 18:02 ice1000

@ice1000 thank you for all the work you've done for the language and for the community. It would be really great if this plugin continue developed. Maybe you can send a message to Zig reddit and ask for volunteers to step up?

anatol avatar Oct 23 '22 15:10 anatol

@ice1000 thank you for all the work you've done for the language and for the community. It would be really great if this plugin continue developed. Maybe you can send a message to Zig reddit and ask for volunteers to step up?

I would expect potential volunteers to be coming here and PR/asking me questions/create new projects directly, and if they're reluctant (or do not have the programming capabilities, as creating IJ plugin = debug a 1M loc Java project everyday) they won't response either.

I've experienced the same with the Julia plugin. The Julia language, I believe, has more users than Zig. The situations are the same.

ice1000 avatar Oct 23 '22 18:10 ice1000

For the original problem, the fix should be relatively simple, something like

class ZigRunConfigurationFactory(type: ConfigurationType) :
...
   override fun getId() = ZIG_RUN_CONFIG_ID
...

I briefly looked at the plugin sources, and I could say that it is indeed a heroic effort to implement and maintain something like this. And it would be a pity to lose such a useful project.

I tried to build the project against the latest idea plugin SDK. I see there are numerous incompatibilities (+ a lot of deprecated API use).

@ice1000 Is there any chance you can reconsider dropping this plugin? I feel you have a lot of Intellij plugin development experience, and somebody like you would be a great leader for the project.

anatol avatar Oct 24 '22 03:10 anatol

A bit of context about why I posted my questions. I am trying to learn Zig. It has some interesting language features that I want to try.

I came from Golang development land and one of the reasons I like Go is that it has great IDE support. Having a good language plugin makes the learning/development process much more pleasant. Zig language definitely needs such IDEA plugin.

anatol avatar Oct 24 '22 03:10 anatol

It has some interesting language features that I want to try.

It was also the reason why I made this project. Unfortunately, I had too many classes in my sophomore year (2019) so I abandoned almost all of my intellij plugin projects.

I tried to build the project against the latest idea plugin SDK. I see there are numerous incompatibilities (+ a lot of deprecated API use).

Yes. I do not have time to fix all of them. What users see is just one error -- the id thing. What I see is those numerous incompatibilities. IntelliJ SDK is changing every single day. I am not paid to do this.

ice1000 avatar Oct 24 '22 04:10 ice1000

Right now, in 2022, I'll have to apply for graduate school, so I have even less time.

ice1000 avatar Oct 24 '22 04:10 ice1000

Basically, there are many issues. I'll try to list the ones I can think of, in case any potential next-hero stumble by.

  1. The obvious problems. Fix the build script (it has some hacks on finding a local IDE so you don't have to download the intellij source to build the project) and the deprecations if possible.
  2. Update the grammar. The Zig language is evolving. The syntax needs to be updated.
  3. Update the way it runs Zig code. See my comment https://github.com/ice1000/intellij-zig/issues/35#issuecomment-770392625
  4. Implement stub indices. This part is undocumented and is the most important thing to make cross-file support work. If you try to do this you'll see how hard ij plugin dev is.

ice1000 avatar Oct 24 '22 04:10 ice1000