TheBlob42 / idea-which-key

IdeaVim extension that displays available keybindings in a popup
GNU General Public License v3.0
180 stars 12 forks source link

Random Error Message #39

Closed Inmoresentum closed 7 months ago

Inmoresentum commented 1 year ago

The below error message appears Randomly when using whichkey plugin.

Intellij IDEA Build And Info:

IntelliJ IDEA 2023.1.2 (Ultimate Edition) Build #IU-231.9011.34, built on May 16, 2023 Runtime version: 17.0.6+10-b829.9 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 6.2.6-76060206-generic GC: G1 Young Generation, G1 Old Generation Memory: 1990M Cores: 24 Registry: debugger.new.tool.window.layout=true ide.experimental.ui=true

Non-Bundled Plugins: IdeaVIM (2.2.0) eu.theblob42.idea.whichkey (0.8.0) com.intellij.grazie.pro (0.3.222) nl.rubensten.texifyidea (0.7.29) Pythonid (231.9011.34) izhangzhihao.rainbow.brackets (2023.2.7) mobi.hsz.idea.gitignore (4.5.0) io.github.mishkun.ideavimsneak (1.2.0) com.firsttimeinforever.intellij.pdf.viewer.intellij-pdf-viewer (0.14.0)

Kotlin: 231-1.8.21-IJ9011.34 Current Desktop: pop:GNOME

Error Message:

Unhandled exception in [StandaloneCoroutine{Cancelling}@61e6d5dc, Dispatchers.Default]

java.lang.ArrayIndexOutOfBoundsException: No such child: 3 at java.desktop/java.awt.Container.getComponent(Container.java:354) at java.desktop/javax.swing.JLayeredPane.insertIndexForLayer(JLayeredPane.java:663) at java.desktop/javax.swing.JLayeredPane.insertIndexForLayer(JLayeredPane.java:638) at java.desktop/javax.swing.JLayeredPane.addImpl(JLayeredPane.java:232) at java.desktop/java.awt.Container.add(Container.java:440) at com.intellij.ui.BalloonImpl.createComponent(BalloonImpl.java:775) at com.intellij.ui.BalloonImpl.show(BalloonImpl.java:569) at com.intellij.ui.BalloonImpl.show(BalloonImpl.java:451) at com.intellij.ui.BalloonImpl.show(BalloonImpl.java:422) at eu.theblob42.idea.whichkey.config.PopupConfig$showPopup$1.invokeSuspend(PopupConfig.kt:145) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelled}@61e6d5dc, Dispatchers.Default]

TheBlob42 commented 1 year ago

So far I have to be honest that I have no idea what could cause this other than maybe some plugin settings :thinking: Could you share your .ideavimrc? Does the problem maybe only occur on a specific key combination (or a specific prefix)?

Inmoresentum commented 1 year ago

Here is my .ideavimrc

"" Source your .vimrc
"source ~/.vimrc

"" -- Suggested options --
" Show a few lines of context around the cursor. Note that this makes the
" text scroll if you mouse-click near the start or end of the window.
set scrolloff=8

"Relative line number"
set number
set relativenumber

" Idea join
set ideajoin
" Setting which-key
set which-key
" disable the timeout option
set notimeout
let g:WhichKey_ShowVimActions = "true"
" Adding plugins that I use most.
set NERDTree
set surround
"IDE mode staff
set showmode

" Do incremental searching.
set incsearch

" Don't use Ex mode, use Q for formatting.
map Q gq

" Tab navigation
nnoremap <A-n> gt
nnoremap <A-p> gT

" leader key
let mapleader=" "
" mapping jj to <ESC>
" inoremap jj <Esc>
" leader e will show error description.
map <Leader>e <Action>(ShowErrorDescription)
"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t
"" Map \r to the Reformat Code action
"map \r <Action>(ReformatCode)

"" Map <leader>d to start debug
"map <leader>d <Action>(Debug)
"" Map \b to toggle the breakpoint on the current line
map \b <Action>(ToggleLineBreakpoint)

" Setting some of my own things
map <buffer>gd <Action>(GotoDeclaration)
map <buffer>gy <Action>(GotoTypeDeclaration)
nmap <buffer> ge <Action>(EditorCodeBlockEnd)
nmap <buffer> gI <Action>(GotoImplementation)
nmap <buffer> gn <Action>(MethodDown)
nmap <buffer> gp <Action>(MethodUp)

map zc <Action>(CollapseRegion)
map zo <Action>(ExpandRegion)

" window splitting & navigation
map <c-o> <Action>(Back)
map <c-i> <Action>(Forward)
map <c-\> <Action>(SplitVertically)
map <c--> <Action>(SplitHorizontally)
map <c-=> <Action>(Unsplit)
map <c-m> <Action>(MoveEditorToOppositeTabGroup)

map <leader>' <Action>(JumpToLastWindow)
map <leader>; <Action>(HideAllWindows)
map <leader>q <Action>(CloseContent)

" Navigation
let g:WhichKeyDesc_navigation = "<leader>n Navigation"
map <leader>ne <Action>(GotoNextError)
let g:WhichKeyDesc_navigation_next_error = "<leader>ne Next Error"
map <leader>no <Action>(NextOccurence)
let g:WhichKeyDesc_navigation_next_occurence = "<leader>no Next Occurrence"
map <leader>ns <Action>(NewScratchFile)
let g:WhichKeyDesc_navigation_new_scratch_file = "<leader>ns New Scratch File"

" Git
let g:WhichKeyDesc_git = "<leader>g Git"
map <leader>gg <Action>(CheckinProject)
let g:WhichKeyDesc_git_checkin = "<leader>gg Checkin"
map <leader>gc <Action>(Git.Branches)
let g:WhichKeyDesc_git_branches = "<leader>gc Branches"
map <leader>gp <Action>(Git.Commit.And.Push.Executor)
let g:WhichKeyDesc_git_commit_and_push = "<leader>gp Commit & Push"
map <leader>gP <Action>(Vcs.Push)
let g:WhichKeyDesc_git_push = "<leader>gP Push"
map <leader>gm <Action>(VcsGroups)
let g:WhichKeyDesc_git_menu = "<leader>gm Menu"
map <leader>gf <Action>(Git.Fetch)
let g:WhichKeyDesc_git_fetch = "<leader>gf Fetch"
map <leader>ga <Action>(Annotate)
let g:WhichKeyDesc_git_annotate = "<leader>ga Annotate"
map <leader>gl <Action>(ActivateVersionControlToolWindow)
let g:WhichKeyDesc_git_log = "<leader>gl Log"
map <leader>gt <Action>(ActivateCommitToolWindow)
let g:WhichKeyDesc_git_tool = "<leader>gt Tool"

""" Tool Windows
let g:WhichKeyDesc_tools = "<leader>t Tools"
map <leader>tm <Action>(ToolWindowsGroup)
let g:WhichKeyDesc_tools_menu = "<leader>tm Menu"
map <leader>tr <Action>(ActivateRunToolWindow)
let g:WhichKeyDesc_tools_run = "<leader>tr Run"
map <leader>tf <Action>(ActivateFindToolWindow)
let g:WhichKeyDesc_tools_find = "<leader>tf Find"
map <leader>tc <Action>(ActivateCommitToolWindow)
let g:WhichKeyDesc_tools_commit = "<leader>tc Commit"
map <leader>td <Action>(ActivateDebugToolWindow)
let g:WhichKeyDesc_tools_debug = "<leader>td Debug"
map <leader>tg <Action>(ActivateVersionControlToolWindow)
let g:WhichKeyDesc_tools_git = "<leader>tg Git"
map <leader>tp <Action>(ActivateProblemsViewToolWindow)
let g:WhichKeyDesc_tools_problems = "<leader>tp Problems"
map <leader>tT <Action>(ActivateTODOToolWindow)
let g:WhichKeyDesc_tools_todos = "<leader>tT Todo's"
map <leader>tt <Action>(ActivateTerminalToolWindow)
let g:WhichKeyDesc_tools_terminal = "<leader>tt Terminal"
map <leader>tj <Action>(JsonPathEvaluateAction)
let g:WhichKeyDesc_tools_json_path = "<leader>tj Json Path Eval"

" Find more examples here: https://jb.gg/share-ideavimrc

Well when this error message occur again I will note down the key combination and prefix and will report back to you. Thanks for the reply :)

TheBlob42 commented 1 year ago

From looking at your configuration everything looks perfectly fine to me. I tested it on my machine and could not reproduce the issue myself. The code from the stacktrace doesn't help me to guess about the possible source of this issue :see_no_evil:

I would need a way to reproduce the issue in order to debug into it and see what I could fix to prevent it in the future. As it never occurred to me I have to rely on your (and others experience). So if you find out how to reproduce the error I would be very grateful and would have another look into it :slightly_smiling_face:

Smallhi commented 8 months ago

some issue @Pycharm and IEDA ( after upgrade, it's fine)

Smallhi commented 8 months ago

java.lang.NoSuchMethodError: 'com.maddyhome.idea.vim.api.VimOptionGroup com.maddyhome.idea.vim.api.VimInjector.getOptionGroup()' at eu.theblob42.idea.whichkey.WhichKeyTypeActionHandler.beforeExecute(WhichKeyTypeActionHandler.kt:34) at com.intellij.openapi.editor.actionSystem.TypedAction.beforeActionPerformed(TypedAction.java:190) at com.intellij.openapi.editor.impl.EditorImpl.processKeyTypedImmediately(EditorImpl.java:1316) at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:1301) at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:3621) at com.intellij.openapi.editor.impl.EditorImpl$6.keyTyped(EditorImpl.java:1139) at java.desktop/java.awt.AWTEventMulticaster.keyTyped(AWTEventMulticaster.java:247) at java.desktop/java.awt.AWTEventMulticaster.keyTyped(AWTEventMulticaster.java:247) at java.desktop/java.awt.AWTEventMulticaster.keyTyped(AWTEventMulticaster.java:247) at java.desktop/java.awt.Component.processKeyEvent(Component.java:6612) at java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2892) at java.desktop/java.awt.Component.processEvent(Component.java:6434) at java.desktop/java.awt.Container.processEvent(Container.java:2266) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855) at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954) at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:886) at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1166) at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1023) at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:849) at com.intellij.ide.IdeKeyboardFocusManager.access$dispatchEvent$s1569605750(IdeKeyboardFocusManager.kt:18) at com.intellij.ide.IdeKeyboardFocusManager$dispatchEvent$1.invoke(IdeKeyboardFocusManager.kt:25) at com.intellij.ide.IdeKeyboardFocusManager$dispatchEvent$1.invoke(IdeKeyboardFocusManager.kt:25) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106) at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014) at com.intellij.ide.IdeKeyboardFocusManager.dispatchEvent(IdeKeyboardFocusManager.kt:25) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4904) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2809) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:794) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:766) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:764) 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:763) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:695) at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.kt:623) at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$11(IdeEventQueue.kt:581) at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:75) at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:67) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:581) at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:72) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:355) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:354) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:349) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114) at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:349) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:848) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:391) 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)

TheBlob42 commented 7 months ago

I'm closing this issue due to inactivity. If the issue still appears randomly with the current version, please reopen this and provide an up to date error message for investigation.

Inmoresentum commented 7 months ago

:(((

Unhandled exception in [StandaloneCoroutine{Cancelling}@435150c8, Dispatchers.Default]

java.lang.ArrayIndexOutOfBoundsException: No such child: 4 at java.desktop/java.awt.Container.getComponent(Container.java:354) at java.desktop/javax.swing.JLayeredPane.insertIndexForLayer(JLayeredPane.java:663) at java.desktop/javax.swing.JLayeredPane.insertIndexForLayer(JLayeredPane.java:638) at java.desktop/javax.swing.JLayeredPane.addImpl(JLayeredPane.java:232) at java.desktop/java.awt.Container.add(Container.java:440) at com.intellij.ui.BalloonImpl.createComponent(BalloonImpl.java:784) at com.intellij.ui.BalloonImpl.show(BalloonImpl.java:574) at com.intellij.ui.BalloonImpl.show(BalloonImpl.java:456) at com.intellij.ui.BalloonImpl.show(BalloonImpl.java:427) at eu.theblob42.idea.whichkey.config.PopupConfig$showPopup$1.invokeSuspend(PopupConfig.kt:155) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelled}@435150c8, Dispatchers.Default]

TheBlob42 commented 7 months ago

I am sorry to hear that the problem still persist. Since the last communication I have not encountered this (or a similar) issue even once.

Please make sure everything is up to date and try to find a way to either reproduce the issue or enclose the root for it. Maybe deactivate some of your other plugins for a while to see if that helps and if so try to re-enable them one by one to see what might cause the conflict. Or see if a "vanilla" configuration of IdeaVim (your .ideavimrc file) helps and just re-add your old configuration till you break it again. Without more information I am unfortunately unable to help here...

Inmoresentum commented 2 months ago

It's been a few months since I experienced this issue. I guess one of the update ideavim or intellij engine itself fixed it?!

Regardless Thank you :) @TheBlob42

TheBlob42 commented 2 months ago

Happy to hear that :slightly_smiling_face: