halirutan / IntelliJ-Key-Promoter-X

Modern IntelliJ plugin to learn shortcuts for buttons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mark the plugin as compatible with EAP 2022.1

rlnt opened this issue · comments

As far as I can see nothing has changed with the way plugins work so marking it as compatible should be enough.

Already pushed. Once GitHub actions return to normal again, I can release it.

The new version you pushed causes issues with the mouse input.
You can still highlight elements but you need to spam the mouse button like crazy until it registers the clicks properly.

It looks like mouse release actions are not registered properly.

Can you explain in detail what "you can still highlight elements" means? Are you referring to something in the editor or something related to the Key Promoter X tool window?

The reason I'm asking is, the only time I'm grabbing raw mouse events is here

https://github.com/halirutan/IntelliJ-Key-Promoter-X/blame/master/src/de/halirutan/keypromoterx/KeyPromoter.java#L92-L104

and this code hasn't changed in over 2 years.

It is really complicated to explain.
When installing the plugin, the issues begin to happen when IntelliJ opens. Right in the project selection.
You are suddenly no longer able to click anything unless you spam LMB on it.
You can still use your keyboard to navigate most of the IDE. This works without any issue.

By "you can still highlight elements" I mean the file explorer. You can still select packages and classes but you are not able to open them by double-clicking them. Right now, I only highlight them with the mouse and then I press Enter to open them.

When I get a pop-up notification, I can't click the actions which are displayed in there (the URL link texts). I am not able to click anything in the quick-fix pop-up.
It looks like the first click is registered properly and then it's like I am holding the mouse button. The release or second click is not registered.

This is all solved when uninstalling the plugin which I was only able to do by navigating with the keyboard.

Puhh.. that sounds not good, especially since I can't reproduce it at the moment. Two more questions:

  • Can you go to Help | About and use the Copy button to provide your installation details?
  • You don't get any exceptions/errors from the IDE, right? Those are shown as an error balloon and later as a blinking red dot in the lower right corner of the IDE. If you get an exception and KPX is the source, can you provide the stacktrace that is shown, when you click on the error?

I get the red light icon that an error occurred but I can't open it because there is no keyboard shortcut to do so. I grabbed the error from the log.

Interestingly, if I spam to open a project, the plugin still works and suggests all kinds of shortcuts.

The version information doesn't contain your plugin because they are not copying when activating it because of the click issue.

IntelliJ IDEA 2022.1 EAP (Ultimate Edition)
Build #IU-221.4165.146, built on February 10, 2022
Licensed to IntelliJ IDEA EAP user
Runtime version: 11.0.14+9-b1982.1 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Registry:
    debugger.mayBringFrameToFrontOnBreakpoint=false
    ide.balloon.shadow.size=15

Non-Bundled Plugins:
    com.samdark.intellij-visual-studio-code-dark-plus (2.5)
    com.intellij.plugins.vscodekeymap (221.4165.146)
    org.sonarlint.idea (6.4.3.42541)
    com.github.copilot (1.1.11.501)
    color.scheme.Relentless-Colors (1.2.2)
    cn.haojiyou.CodeGlance3 (2.1.1-2021.1.3)
    com.mallowigi (60.0.0)
    izhangzhihao.rainbow.brackets (6.21)
    AceJump (3.8.5)

Kotlin: 221-1.6.10-release-952-IJ4165.146
Exception in plugin Key Promoter X (2022.1)
java.lang.NoClassDefFoundError: com/intellij/openapi/wm/impl/StripeButton
	at de.halirutan.keypromoterx.KeyPromoter.handleMouseEvent(KeyPromoter.java:63)
	at de.halirutan.keypromoterx.KeyPromoter.eventDispatched(KeyPromoter.java:100)
	at java.desktop/java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2199)
	at java.desktop/java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2091)
	at java.desktop/java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2090)
	at java.desktop/java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2090)
	at java.desktop/java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2090)
	at java.desktop/java.awt.Toolkit.notifyAWTEventListeners(Toolkit.java:2047)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4935)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2790)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:885)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:814)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:737)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:433)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:802)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:432)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:119)
	at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:598)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:430)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:478)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.ClassNotFoundException: com.intellij.openapi.wm.impl.StripeButton PluginClassLoader(plugin=PluginDescriptor(name=Key Promoter X, id=Key Promoter X, descriptorPath=plugin.xml, path=~\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\221.4165.146.plugins\Key-Promoter-X, version=2022.1, package=null, isBundled=false), packagePrefix=null, instanceId=67, state=active)
	at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:210)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 45 more

Thanks a lot. I think I have a clue. The implementation for the buttons of the tool windows was replaced completely and since it's not exactly API that one should use, there was no warning. This is why you get the exception (only in the latest EAP). However, the instanceof StripeButton check happens basically all the time. There is a chance that your JVM on Windows gets crazy if you continuously check for a non-existing class.

I'm sorry, but I had to remove this update and you can't use KPX on the EAP for a bit longer. I need to figure out some things first.

There will definitely be a clean-cut regarding the KPX version. The one that runs on IntelliJ versions before the current EAP won't run on the current EAP or later.

@DAmNRelentless Would you be so kind to try out the attached version? It only works in with the latest EAP version 221.4165.146.

Key-Promoter-X-2022.1.1.zip

This version works as it should. Good job!
While we're at it. Did you ever think about adding a similar plugin to something like VSCode? This would be lovely!

Hey @DAmNRelentless. I really know nothing about VSCode. If I really just want an editor, I'm fine with vim, midnight-commander or even gedit. Sorry, you'll have to do that one yourself :)