wakatime / jetbrains-wakatime

IntelliJ IDEA, PyCharm, RubyMine, PhpStorm, AppCode, AndroidStudio, Goland, Rider, & WebStorm plugin for quantifying your coding.
https://wakatime.com/intellij-idea
BSD 3-Clause "New" or "Revised" License
1.12k stars 162 forks source link

Frequent exception in phpStorm when comparing files with external project (WSL) #267

Closed funder7 closed 9 months ago

funder7 commented 9 months ago

Hi,

In my setup theres an exception that raises very frequently. There's some problem with the editor cursor (like is written in the exception), but it seems to happen most of the time when I'm using the diff window, to compare a project file with another external to the project I'm working onto.

It looks like the exception is thrown when opening the internal diff tool, just after placing the cursor anywhere in the second column (current file contents).

I'm on Windows and using WSL if that can help.

The stacktrace:

java.lang.Throwable: Assertion failed: Caret model is in its update process. All requests are illegal at this point.
    at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:465)
    at com.intellij.openapi.editor.impl.CaretImpl.assertNotUpdating(CaretImpl.java:621)
    at com.intellij.openapi.editor.impl.CaretImpl.getOffset(CaretImpl.java:665)
    at com.intellij.openapi.editor.CaretModel.getOffset(CaretModel.java:129)
    at com.wakatime.intellij.plugin.CustomVisibleAreaListener.visibleAreaChanged(CustomVisibleAreaListener.java:33)
    at jdk.internal.reflect.GeneratedMethodAccessor188.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at com.intellij.util.EventDispatcher.dispatchVoidMethod(EventDispatcher.java:118)
    at com.intellij.util.EventDispatcher.lambda$createMulticaster$1(EventDispatcher.java:83)
    at jdk.proxy2/jdk.proxy2.$Proxy128.visibleAreaChanged(Unknown Source)
    at com.intellij.openapi.editor.impl.ScrollingModelImpl$MyChangeListener.lambda$stateChanged$0(ScrollingModelImpl.java:457)
    at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:64)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:923)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:76)
    at com.intellij.openapi.application.ReadAction.run(ReadAction.java:63)
    at com.intellij.openapi.editor.impl.ScrollingModelImpl$MyChangeListener.stateChanged(ScrollingModelImpl.java:446)
    at java.desktop/javax.swing.JViewport.fireStateChanged(JViewport.java:1494)
    at java.desktop/javax.swing.JViewport.setViewPosition(JViewport.java:1244)
    at com.intellij.ui.components.JBViewport.setViewPosition(JBViewport.java:106)
    at java.desktop/javax.swing.plaf.basic.BasicScrollPaneUI$Handler.vsbStateChanged(BasicScrollPaneUI.java:1189)
    at java.desktop/javax.swing.plaf.basic.BasicScrollPaneUI$Handler.stateChanged(BasicScrollPaneUI.java:1178)
    at java.desktop/javax.swing.DefaultBoundedRangeModel.fireStateChanged(DefaultBoundedRangeModel.java:371)
    at com.intellij.ui.components.JBScrollBar$Model.fireStateChanged(JBScrollBar.java:369)
    at java.desktop/javax.swing.DefaultBoundedRangeModel.setRangeProperties(DefaultBoundedRangeModel.java:309)
    at java.desktop/javax.swing.DefaultBoundedRangeModel.setValue(DefaultBoundedRangeModel.java:175)
    at java.desktop/javax.swing.JScrollBar.setValue(JScrollBar.java:486)
    at com.intellij.ui.components.JBScrollBar.setValue(JBScrollBar.java:202)
    at com.intellij.openapi.editor.impl.ScrollingModelImpl._scrollVertically(ScrollingModelImpl.java:220)
    at com.intellij.openapi.editor.impl.ScrollingModelImpl.scroll(ScrollingModelImpl.java:282)
    at com.intellij.openapi.editor.impl.ScrollingModelImpl.scrollVertically(ScrollingModelImpl.java:213)
    at com.intellij.diff.tools.util.SyncScrollSupport.doScrollVertically(SyncScrollSupport.java:452)
    at com.intellij.diff.tools.util.SyncScrollSupport$ScrollHelper.syncVerticalScroll(SyncScrollSupport.java:405)
    at com.intellij.diff.tools.util.SyncScrollSupport$ScrollHelper.visibleAreaChanged(SyncScrollSupport.java:342)
    at com.intellij.diff.tools.util.SyncScrollSupport$TwosideSyncScrollSupport.visibleAreaChanged(SyncScrollSupport.java:90)
    at com.intellij.diff.tools.util.side.TwosideTextDiffViewer$MyVisibleAreaListener.visibleAreaChanged(TwosideTextDiffViewer.java:369)
    at com.intellij.openapi.editor.impl.ScrollingModelImpl$MyChangeListener.lambda$stateChanged$0(ScrollingModelImpl.java:457)
    at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:64)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:923)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:76)
    at com.intellij.openapi.application.ReadAction.run(ReadAction.java:63)
    at com.intellij.openapi.editor.impl.ScrollingModelImpl$MyChangeListener.stateChanged(ScrollingModelImpl.java:446)
    at java.desktop/javax.swing.JViewport.fireStateChanged(JViewport.java:1494)
    at java.desktop/javax.swing.JViewport.setViewPosition(JViewport.java:1244)
    at com.intellij.ui.components.JBViewport.setViewPosition(JBViewport.java:106)
    at java.desktop/javax.swing.plaf.basic.BasicScrollPaneUI$Handler.vsbStateChanged(BasicScrollPaneUI.java:1189)
    at java.desktop/javax.swing.plaf.basic.BasicScrollPaneUI$Handler.stateChanged(BasicScrollPaneUI.java:1178)
    at java.desktop/javax.swing.DefaultBoundedRangeModel.fireStateChanged(DefaultBoundedRangeModel.java:371)
    at com.intellij.ui.components.JBScrollBar$Model.fireStateChanged(JBScrollBar.java:369)
    at java.desktop/javax.swing.DefaultBoundedRangeModel.setRangeProperties(DefaultBoundedRangeModel.java:309)
    at java.desktop/javax.swing.JScrollBar.setValues(JScrollBar.java:634)
    at java.desktop/javax.swing.plaf.basic.BasicScrollPaneUI.syncScrollPaneWithViewport(BasicScrollPaneUI.java:342)
    at java.desktop/javax.swing.plaf.basic.BasicScrollPaneUI$Handler.stateChanged(BasicScrollPaneUI.java:1168)
    at java.desktop/javax.swing.JViewport.fireStateChanged(JViewport.java:1494)
    at java.desktop/javax.swing.JViewport$ViewListener.componentResized(JViewport.java:1413)
    at java.desktop/java.awt.Component.processComponentEvent(Component.java:6483)
    at com.intellij.openapi.editor.impl.EditorComponentImpl.fireResized(EditorComponentImpl.java:217)
    at com.intellij.openapi.editor.impl.EditorImpl.validateSize(EditorImpl.java:1844)
    at com.intellij.openapi.editor.impl.EditorImpl.onInlayUpdated(EditorImpl.java:665)
    at com.intellij.openapi.editor.impl.EditorImpl$5.onUpdated(EditorImpl.java:516)
    at com.intellij.openapi.editor.InlayModel$SimpleAdapter.onRemoved(InlayModel.java:350)
    at jdk.internal.reflect.GeneratedMethodAccessor448.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at com.intellij.util.EventDispatcher.dispatchVoidMethod(EventDispatcher.java:118)
    at com.intellij.util.EventDispatcher.lambda$createMulticaster$1(EventDispatcher.java:83)
    at jdk.proxy2/jdk.proxy2.$Proxy221.onRemoved(Unknown Source)
    at com.intellij.openapi.editor.impl.InlayModelImpl.notifyRemoved(InlayModelImpl.java:549)
    at com.intellij.openapi.editor.impl.InlayImpl.dispose(InlayImpl.java:98)
    at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:129)
    at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:161)
    at com.intellij.openapi.util.Disposer.dispose(Disposer.java:262)
    at com.intellij.openapi.util.Disposer.dispose(Disposer.java:250)
    at com.intellij.diff.tools.simple.SimpleAlignedDiffModel.clear(SimpleAlignedDiffModel.kt:153)
    at com.intellij.diff.tools.simple.SimpleAlignedDiffModel.realignChanges$lambda$5(SimpleAlignedDiffModel.kt:147)
    at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:110)
    at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:27)
    at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:65)
    at com.intellij.diff.tools.simple.SimpleAlignedDiffModel.realignChanges(SimpleAlignedDiffModel.kt:146)
    at com.intellij.diff.tools.simple.SimpleAlignedDiffModel.access$realignChanges(SimpleAlignedDiffModel.kt:27)
    at com.intellij.diff.tools.simple.SimpleAlignedDiffModel$MySoftWrapModelListener.recalculationEnds(SimpleAlignedDiffModel.kt:200)
    at com.intellij.openapi.editor.impl.SoftWrapModelImpl$1.recalculationEnds(SoftWrapModelImpl.java:121)
    at com.intellij.openapi.editor.impl.softwrap.mapping.SoftWrapApplianceManager.onRecalculationEnd(SoftWrapApplianceManager.java:201)
    at com.intellij.openapi.editor.impl.softwrap.mapping.SoftWrapApplianceManager.recalculate(SoftWrapApplianceManager.java:128)
    at com.intellij.openapi.editor.impl.softwrap.mapping.SoftWrapApplianceManager.documentChanged(SoftWrapApplianceManager.java:429)
    at com.intellij.openapi.editor.impl.SoftWrapModelImpl.documentChanged(SoftWrapModelImpl.java:481)
    at com.intellij.openapi.editor.impl.DocumentImpl.lambda$changedUpdate$1(DocumentImpl.java:913)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:222)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:230)
    at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:64)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:230)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:221)
    at com.intellij.openapi.editor.impl.DocumentImpl.changedUpdate(DocumentImpl.java:910)
    at com.intellij.openapi.editor.impl.DocumentImpl.updateText(DocumentImpl.java:814)
    at com.intellij.openapi.editor.impl.DocumentImpl.replaceString(DocumentImpl.java:654)
    at com.intellij.openapi.editor.impl.DocumentImpl.replaceString(DocumentImpl.java:591)
    at com.intellij.psi.formatter.DocumentBasedFormattingModel.replaceWhiteSpace(DocumentBasedFormattingModel.java:151)
    at com.intellij.formatting.engine.FormatProcessorUtils.replaceWhiteSpace(FormatProcessorUtils.java:31)
    at com.intellij.formatting.engine.ApplyChangesState.doIteration(ApplyChangesState.java:175)
    at com.intellij.formatting.engine.State.iteration(State.java:25)
    at com.intellij.formatting.engine.StateProcessor.iteration(StateProcessor.java:26)
    at com.intellij.formatting.FormatProcessor.doIterationsSynchronously(FormatProcessor.java:148)
    at com.intellij.formatting.FormatProcessor.performModifications(FormatProcessor.java:143)
    at com.intellij.formatting.FormatProcessor.performModifications(FormatProcessor.java:133)
    at com.intellij.formatting.FormatterImpl.adjustLineIndentsForRange(FormatterImpl.java:301)
    at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$3.doPerform(CodeStyleManagerImpl.java:274)
    at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerRunnable.perform(CodeStyleManagerRunnable.java:92)
    at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.adjustLineIndent(CodeStyleManagerImpl.java:277)
    at com.intellij.codeInsight.editorActions.DefaultTypingActionsExtension.adjustLineIndent(DefaultTypingActionsExtension.java:86)
    at com.intellij.codeInsight.editorActions.DefaultTypingActionsExtension.indentEachLine(DefaultTypingActionsExtension.java:165)
    at com.intellij.codeInsight.editorActions.DefaultTypingActionsExtension.format(DefaultTypingActionsExtension.java:66)
    at com.intellij.codeInsight.editorActions.PasteHandler.lambda$doPasteAction$4(PasteHandler.java:270)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:992)
    at com.intellij.codeInsight.editorActions.PasteHandler.doPasteAction(PasteHandler.java:268)
    at com.intellij.codeInsight.editorActions.PasteHandler.doPaste(PasteHandler.java:122)
    at com.intellij.codeInsight.editorActions.PasteHandler.lambda$execute$2(PasteHandler.java:103)
    at com.intellij.openapi.project.DumbService.runWithAlternativeResolveEnabled(DumbService.kt:309)
    at com.intellij.codeInsight.editorActions.PasteHandler.execute(PasteHandler.java:94)
    at com.intellij.codeInsight.editorActions.PasteHandler.doExecute(PasteHandler.java:60)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.lambda$execute$4(EditorActionHandler.java:199)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:89)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:198)
    at com.intellij.codeInsight.editorActions.LanguageConsolePasteHandler.doExecute(LanguageConsolePasteHandler.kt:24)
    at com.intellij.openapi.editor.actionSystem.DynamicEditorActionHandler.doExecute(DynamicEditorActionHandler.java:63)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.lambda$execute$4(EditorActionHandler.java:199)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:89)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:198)
    at com.intellij.openapi.editor.actionSystem.EditorAction.lambda$actionPerformed$0(EditorAction.java:93)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:174)
    at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:102)
    at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:77)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:339)
    at com.intellij.openapi.keymap.impl.ActionProcessor.performAction(ActionProcessor.java:47)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$myActionProcessor$1.performAction(IdeKeyEventDispatcher.kt:502)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$5$lambda$4(IdeKeyEventDispatcher.kt:865)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$5(IdeKeyEventDispatcher.kt:865)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:362)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner(IdeKeyEventDispatcher.kt:863)
    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:587)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.kt:513)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.kt:454)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.kt:447)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.kt:309)
    at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.kt:617)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:587)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:992)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:992)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405)
    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)

Some logs from Wakatime (XXXX is current project, YYYY is the external one)

2023-09-23 10:30:30,255 [63934247]   FINE - WakaTime - Command finished with return value: 0
2023-09-23 10:30:41,410 [63945402]   FINE - WakaTime - Executing CLI: [C:\Users\---\.wakatime\wakatime-cli-windows-amd64.exe, --plugin, PhpStorm/2023.2.2 PhpStorm-wakatime/14.2.1, --entity, //wsl$/Ubuntu-22.04/home/benz/myrepo/XXXX/XXXX/tsconfig.json, --time, 1695457812.2310, --key, XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXcec2, --lines-in-file, 79, --alternate-project, XXXX, --alternate-language, tsconfig, --extra-heartbeats]
2023-09-23 10:30:41,435 [63945427]   FINE - WakaTime - [{"entity":"//wsl$/Ubuntu-22.04/home/----/myrepo/YYYY/tsconfig.json","timestamp":1695457812.2460,"is_write":false,"lines":81,"lineno":79,"cursorpos":4,"alternate_project":"XXXX","language":"tsconfig"},

My IDE configuration:

PhpStorm 2023.2.2
Build #PS-232.9921.55, built on September 15, 2023
Runtime version: 17.0.8+7-b1000.22 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11.0
GC: G1 Young Generation, G1 Old Generation
Memory: 3040M
Cores: 8

Registry:
    ide.editor.tab.selection.animation=true
    debugger.watches.in.variables=false
    debugger.new.tool.window.layout=true
    run.processes.with.pty=TRUE
    documentation.show.toolbar=true
    ide.experimental.ui=true
    ide.balloon.shadow.size=0

Non-Bundled Plugins:
    com.intellij.datagen (232.8660.88)
    com.jetbrains.webstorm.web-assembly-plugin (1.4.232)
    org.toml.lang (232.8660.88)
    com.villains.intelij.plugin.trashpandatheme (2.0.6)
    lermitage.intellij.ilovedevtoys (1.9.1)
    org.jetbrains.settingsRepository (232.9921.28)
    com.github.davidenkoim.idnamessuggestingplugin (0.2.1)
    com.jetbrains.naming-is-hard (1.4.0)
    String Manipulation (9.11.3)
    org.zalando.intellij.swagger (1.2.0)
    com.shuzijun.markdown-editor (2.0.5)
    com.wakatime.intellij.plugin (14.2.1)
    com.intellij.mermaid (0.0.15+IJ.232)
    com.intellij.grazie.pro (0.3.250)
    ru.adelf.idea.dotenv (2023.2)
    net.seesharpsoft.intellij.plugins.csv (3.2.1-232)
    com.intellij.ml.llm (232.9826)
    com.github.aleksandrsl.intellijbrowserslist (1.0.2)
    com.github.ArtsiomCh.NestedBracketsColorer (0.7.1)
    com.jetbrains.plugins.yeoman (232.8660.129)
    com.niclas-van-eyk.laravel-make-integration (3.6.0)
    com.intellij.tide (232.8660.88)
    tv.twelvetone.intellij.plugins.intellivue (1.1.41)
    com.laravel_idea.plugin (7.3.0.232)
    mobi.hsz.idea.gitignore (4.5.1)
    com.firsttimeinforever.intellij.pdf.viewer.intellij-pdf-viewer (0.15.0)
alanhamlett commented 9 months ago

Fixed in v14.2.2 by suppressing the exception unless debug mode is enabled.