AceJump icon indicating copy to clipboard operation
AceJump copied to clipboard

AceJump doesn't show labels in a diff viewer

Open h0tk3y opened this issue 3 years ago • 5 comments

Describe the bug If I try to use one of the AceJump actions in the IntelliJ IDEA Diff Viewer editor, it won't show the jump labels and will throw an exception, not allowing me to complete the jump.

The stack trace of the exception is as follows:

Stack trace
java.util.NoSuchElementException: Collection is empty.
	at kotlin.collections.CollectionsKt___CollectionsKt.first(_Collections.kt:201)
	at org.acejump.view.TextHighlighter.showSearchNotification(TextHighlighter.kt:96)
	at org.acejump.view.TextHighlighter.render(TextHighlighter.kt:78)
	at org.acejump.session.Session.updateSearch(Session.kt:117)
	at org.acejump.session.Session.updateSearch$default(Session.kt:109)
	at org.acejump.session.Session.startRegexSearch(Session.kt:192)
	at org.acejump.session.Session.startRegexSearch(Session.kt:202)
	at org.acejump.action.AceAction$BaseRegexSearchAction.invoke(AceAction.kt:64)
	at org.acejump.action.AceAction.actionPerformed(AceAction.kt:35)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:323)
	at com.intellij.ide.actions.GotoActionAction.lambda$performActionImpl$4(GotoActionAction.java:91)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:346)
	at com.intellij.ide.actions.GotoActionAction.performActionImpl(GotoActionAction.java:90)
	at com.intellij.ide.actions.GotoActionAction.lambda$performAction$2(GotoActionAction.java:70)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:813)
	at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:429)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:74)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:114)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:36)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:749)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:909)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:756)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$5(IdeEventQueue.java:437)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:774)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:436)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:615)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:434)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:813)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:480)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

To Reproduce Steps to reproduce the behavior:

  1. Run the IntelliJ IDEA action "Open Blank Diff Window" (through Ctrl/Cmd+Shift+A)
  2. Type something in the diff editor
  3. Run one of the AceJump actions that should allow you to jump
  4. The cursor now changes accordingly to the AceJump actions, but no labels are displayed in the editor when you start typing the search term (nor immediately, if it's a line-based action)

Expected behavior AceJump works in the Diff Viewer editors

Screenshots image

Desktop (please complete the following information):

  • OS: macOS
  • IntelliJ IDEA 2022.x
  • AceJump version 3.8.8

h0tk3y avatar Oct 27 '22 16:10 h0tk3y

One more editor kind where AceJump can be triggered but does not render hints is the Kotlin REPL.

h0tk3y avatar Jun 28 '23 18:06 h0tk3y

One more editor affected by this is the preview editor of the Find in Files... dialogue (⌘⇧F).

h0tk3y avatar Jul 13 '23 18:07 h0tk3y

Hi Sergey, thank you for documenting this behavior. I would like to fix it, but as far as I have tried, I have been unsuccessful in finding the API endpoint. Any suggestions are welcome.

breandan avatar Jul 13 '23 18:07 breandan

@breandan Thanks for trying! Unfortunately, I don't have IDE plugin development experience and can't help much. Should we try to ask someone from the IntelliJ Team at JetBrains?

h0tk3y avatar Jul 13 '23 20:07 h0tk3y

Oh, I see you moved to Gradle. Congrats man! I just asked on the forums as @karollewandowski suggested, let's see what they say.

breandan avatar Jul 13 '23 20:07 breandan