dkandalov / tab-shifter

Plugin for IntelliJ IDEA to move and split editor tabs
https://plugins.jetbrains.com/plugin/7475
169 stars 12 forks source link

ClassCastException: EditorTabs cannot be cast to JPanel #33

Open dkandalov opened 11 months ago

dkandalov commented 11 months ago
java.lang.ClassCastException: class com.intellij.openapi.fileEditor.impl.EditorTabs cannot be cast to class javax.swing.JPanel (com.intellij.openapi.fileEditor.impl.EditorTabs is in unnamed module of loader com.intellij.util.lang.PathClassLoader @387c703b; javax.swing.JPanel is in module java.desktop of loader 'bootstrap')
    at tabshifter.Ide.snapshotWindowLayout(Ide.kt:69)
    at tabshifter.TabShifterKt.windowLayoutSnapshotWithPositions(TabShifter.kt:107)
    at tabshifter.TabShifterKt.access$windowLayoutSnapshotWithPositions(TabShifter.kt:1)
    at tabshifter.TabShifter.stretchSplitter(TabShifter.kt:58)
    at tabshifter.Actions$StretchDown.actionPerformed(Actions.kt:85)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:350)
    at com.intellij.openapi.keymap.impl.ActionProcessor.performAction(ActionProcessor.java:32)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$myActionProcessor$1.performAction(IdeKeyEventDispatcher.kt:494)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$5$lambda$4(IdeKeyEventDispatcher.kt:834)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$5(IdeKeyEventDispatcher.kt:834)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:374)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner(IdeKeyEventDispatcher.kt:832)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.access$doPerformActionInner(IdeKeyEventDispatcher.kt:1)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction$intellij_platform_ide_impl(IdeKeyEventDispatcher.kt:559)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.kt:505)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.kt:446)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.kt:439)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.kt:301)
    at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.kt:619)
    at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$11(IdeEventQueue.kt:580)
    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:580)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:71)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:353)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:353)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:348)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1006)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1006)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:348)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:851)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:390)
    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)
tedyoung commented 9 months ago

Confirm that this still exists:

v0.33 of Tab Shifter throws an exception (stack trace below) when using it in IntelliJ IDEA 2023.3 Beta (November 21, 2023 build).

IntelliJ IDEA 2023.3 Beta (Ultimate Edition) Build #IU-233.11799.67, built on November 21, 2023 macOS 12.6.9

tedyoung commented 9 months ago

@dkandalov Any ideas on how to fix this? Seems like a module issue, so not sure if this is JetBrains' problem or not? Anything I can do to help?

dkandalov commented 9 months ago

@tedyoung I think it's fixed in this commit https://github.com/dkandalov/tab-shifter/commit/395b6aee915819cf0b29baadeb5d3e8842d04939

The way UI components structured internally has changed in the new version of IntelliJ. The plugin relies on it (in a hacky way), so it got broken.

The most helpful thing would be for Jetbrains to take over this functionality. I'm not really using this plugin anyway 🤷‍♂️