intellij-solidity / intellij-solidity

Solidity plugin for IntelliJ

Home Page:https://plugins.jetbrains.com/plugin/9475-intellij-solidity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Cannot show diff (git)

adrian-pusty opened this issue · comments

(IntelliJ IDEA 2021.3.2 (Community Edition)) → Git → Log → {double click on .sol file}
solidity_plugin_issue

In my case I had to disable solidity plugin to be able to show the diff (I checked it because of the answer I found by google searching "intellij cannot show diff")

(Please close this issue in case it is the duplicated one or if it is known issue and the problem lies on the IDE side)

Hey, @adrianpusty! Could this be an issue with your local setup? I can't reproduce it.
Screen Shot 2022-07-25 at 9 03 34 pm

Potentially, looking through IJ logs for errors similar to the one you linked might reveal the issue.

Thanks for the reply @SerCeMan.
Not sure, maybe it's a problem with my local setup.
This seems to be the log which corresponds with the issue (strangely, the problem does not occur with every .sol file that I check in the "Log" tab.):

2022-07-30 23:10:22,449 [1278060]  ERROR - diff.impl.DiffRequestProcessor - Unexpected termination offset for lexer FlexAdapter for me.serce.solidity._SolidityLexer 
java.lang.IllegalStateException: Unexpected termination offset for lexer FlexAdapter for me.serce.solidity._SolidityLexer
	at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.doSetText(LexerEditorHighlighter.java:461)
	at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.setText(LexerEditorHighlighter.java:420)
	at com.intellij.openapi.editor.impl.EditorImpl.setHighlighter(EditorImpl.java:1332)
	at com.intellij.diff.util.DiffUtil.setEditorHighlighter(DiffUtil.java:196)
	at com.intellij.diff.util.DiffUtil.configureEditor(DiffUtil.java:263)
	at com.intellij.diff.tools.holders.TextEditorHolder.create(TextEditorHolder.java:97)
	at com.intellij.diff.tools.holders.TextEditorHolder$TextEditorHolderFactory.create(TextEditorHolder.java:107)
	at com.intellij.diff.tools.holders.TextEditorHolder$TextEditorHolderFactory.create(TextEditorHolder.java:101)
	at com.intellij.diff.tools.util.side.TwosideDiffViewer.createEditorHolders(TwosideDiffViewer.java:106)
	at com.intellij.diff.tools.util.side.TwosideTextDiffViewer.createEditorHolders(TwosideTextDiffViewer.java:115)
	at com.intellij.diff.tools.util.side.TwosideDiffViewer.(TwosideDiffViewer.java:53)
	at com.intellij.diff.tools.util.side.TwosideTextDiffViewer.(TwosideTextDiffViewer.java:67)
	at com.intellij.diff.tools.simple.SimpleDiffViewer.(SimpleDiffViewer.java:63)
	at com.intellij.diff.tools.simple.SimpleDiffTool.createComponent(SimpleDiffTool.java:31)
	at com.intellij.diff.impl.DiffRequestProcessor.createState(DiffRequestProcessor.java:284)
	at com.intellij.diff.impl.DiffRequestProcessor.lambda$doApplyRequest$4(DiffRequestProcessor.java:359)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:222)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:237)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:221)
	at com.intellij.diff.impl.DiffRequestProcessor.lambda$doApplyRequest$5(DiffRequestProcessor.java:353)
	at com.intellij.diff.util.DiffUtil.runPreservingFocus(DiffUtil.java:760)
	at com.intellij.diff.impl.DiffRequestProcessor.doApplyRequest(DiffRequestProcessor.java:343)
	at com.intellij.diff.impl.DiffRequestProcessor.lambda$applyRequest$3(DiffRequestProcessor.java:325)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$doWhenFocusSettlesDown$3(FocusManagerImpl.java:184)
	at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:101)
	at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:186)
	at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:140)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:175)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:181)
	at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:41)
	at com.intellij.diff.impl.DiffRequestProcessor.applyRequest(DiffRequestProcessor.java:333)
	at com.intellij.diff.impl.DiffRequestProcessor.applyRequest(DiffRequestProcessor.java:312)
	at com.intellij.diff.impl.CacheDiffRequestProcessor.lambda$updateRequest$0(CacheDiffRequestProcessor.java:117)
	at com.intellij.openapi.progress.util.BackgroundTaskUtil.finish(BackgroundTaskUtil.java:111)
	at com.intellij.openapi.progress.util.BackgroundTaskUtil.executeAndTryWait(BackgroundTaskUtil.java:99)
	at com.intellij.diff.util.DiffTaskQueue.executeAndTryWait(DiffTaskQueue.java:47)
	at com.intellij.diff.util.DiffTaskQueue.executeAndTryWait(DiffTaskQueue.java:38)
	at com.intellij.diff.impl.CacheDiffRequestProcessor.updateRequest(CacheDiffRequestProcessor.java:112)
	at com.intellij.diff.impl.CacheDiffRequestProcessor.updateRequest(CacheDiffRequestProcessor.java:91)
	at com.intellij.diff.impl.DiffRequestProcessor.updateRequest(DiffRequestProcessor.java:195)
	at com.intellij.diff.impl.DiffRequestProcessor.updateRequest(DiffRequestProcessor.java:190)
	at com.intellij.openapi.vcs.changes.ChangeViewDiffRequestProcessor.setCurrentChange(ChangeViewDiffRequestProcessor.java:189)
	at com.intellij.openapi.vcs.changes.ChangeViewDiffRequestProcessor.refresh(ChangeViewDiffRequestProcessor.java:170)
	at com.intellij.openapi.vcs.changes.ChangeViewDiffRequestProcessor.updatePreview(ChangeViewDiffRequestProcessor.java:95)
	at com.intellij.vcs.log.ui.frame.VcsLogChangeProcessor.updatePreview(VcsLogChangeProcessor.java:82)
	at com.intellij.vcs.log.ui.frame.VcsLogEditorDiffPreview.createDiffRequestProcessor(VcsLogDiffPreview.kt:146)
	at com.intellij.openapi.vcs.changes.PreviewDiffVirtualFile.createProcessor(PreviewDiffVirtualFile.java:34)
	at com.jetbrains.rdserver.vcs.BackendDiffFileEditorProvider.createEditor(BackendDiffViewerHost.kt:90)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl4Edt(FileEditorManagerImpl.java:1004)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl4$17(FileEditorManagerImpl.java:976)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.runBulkTabChange(FileEditorManagerImpl.java:1793)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl4$18(FileEditorManagerImpl.java:975)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:437)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:455)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl4(FileEditorManagerImpl.java:972)
	at com.jetbrains.rdserver.fileEditors.BackendServerFileEditorManager.openFileImpl4(BackendServerFileEditorManager.kt:43)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl2$14(FileEditorManagerImpl.java:898)
	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.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:164)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:150)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl2(FileEditorManagerImpl.java:897)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl2(FileEditorManagerImpl.java:890)
	at com.intellij.ui.docking.impl.DockManagerImpl.createNewDockContainerFor(DockManagerImpl.java:424)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileInNewWindow(FileEditorManagerImpl.java:818)
	at com.intellij.openapi.vcs.changes.VcsEditorTabFilesManager.openFile(VcsEditorTabFilesManager.kt:71)
	at com.intellij.openapi.vcs.changes.VcsEditorTabFilesManager.openFile(VcsEditorTabFilesManager.kt:60)
	at com.intellij.openapi.vcs.changes.EditorTabDiffPreviewManager.showDiffFile(EditorTabDiffPreviewManager.kt:38)
	at com.intellij.openapi.vcs.changes.EditorTabPreview$Companion.openPreview(EditorTabPreview.kt:163)
	at com.intellij.vcs.log.ui.frame.EditorDiffPreview.openPreviewInEditor(VcsLogDiffPreview.kt:121)
	at com.intellij.vcs.log.ui.frame.EditorDiffPreview.setPreviewVisible(VcsLogDiffPreview.kt:110)
	at com.intellij.openapi.vcs.changes.EditorTabDiffPreviewManager.showDiffPreview(EditorTabDiffPreviewManager.kt:42)
	at com.intellij.openapi.vcs.changes.ui.ChangesBrowserBase.showDiff(ChangesBrowserBase.java:304)
	at com.intellij.openapi.vcs.changes.ui.ChangesBrowserBase.onDoubleClick(ChangesBrowserBase.java:220)
	at com.intellij.openapi.vcs.changes.ui.ChangesTree.lambda$setDoubleClickAndEnterKeyHandler$3(ChangesTree.java:264)
	at com.intellij.openapi.vcs.changes.ui.ChangesTreeHandlers$createDoubleClickListener$1.onDoubleClick(ChangesTreeHandlers.kt:52)
	at com.intellij.ui.DoubleClickListener.onClick(DoubleClickListener.java:30)
	at com.intellij.ui.ClickListener$1.mouseReleased(ClickListener.java:59)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6654)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
	at com.intellij.ui.treeStructure.Tree.processMouseEvent(Tree.java:394)
	at java.desktop/java.awt.Component.processEvent(Component.java:6419)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at com.intellij.openapi.vcs.changes.ui.ChangesTree.processEvent(ChangesTree.java:761)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5029)
	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:891)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:820)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:757)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:498)
	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)
2022-07-30 23:10:22,482 [1278093]  ERROR - diff.impl.DiffRequestProcessor - IntelliJ IDEA 2021.3.2  Build #IC-213.6777.52 
2022-07-30 23:10:22,486 [1278097]  ERROR - diff.impl.DiffRequestProcessor - JDK: 11.0.13; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o. 
2022-07-30 23:10:22,486 [1278097]  ERROR - diff.impl.DiffRequestProcessor - OS: Linux 
2022-07-30 23:10:22,487 [1278098]  ERROR - diff.impl.DiffRequestProcessor - Current Command:  
2022-07-30 23:10:22,801 [1278412]   WARN - try.DefaultSentryClientFactory - No 'stacktrace.app.packages' was configured, this option is highly recommended as it affects stacktrace grouping and display on Sentry. See documentation: https://docs.sentry.io/clients/java/config/#in-application-stack-frames 
2022-07-30 23:10:22,809 [1278420]   WARN - try.DefaultSentryClientFactory - No 'stacktrace.app.packages' was configured, this option is highly recommended as it affects stacktrace grouping and display on Sentry. See documentation: https://docs.sentry.io/clients/java/config/#in-application-stack-frames 
2022-07-30 23:10:24,691 [1280302]   INFO - re.component.SaveActionManager - [+] Start SaveActionManager#beforeAllDocumentsSaving 
2022-07-30 23:10:24,691 [1280302]   INFO - re.component.SaveActionManager - Locating psi files for 0 documents: [] 
2022-07-30 23:10:24,691 [1280302]   INFO - re.component.SaveActionManager - End SaveActionManager#beforeAllDocumentsSaving 
2022-07-30 23:10:25,069 [1280680]   INFO - rationStore.ComponentStoreImpl - Saving appPlantUmlSettingsNew took 24 ms, XDebuggerSettings took 16 ms 

Thanks! Could you attach a couple of minimal files that can reproduce the issue?

Will it be enough if I paste a link to one of the commits for which the problem occurs? (there is only one changed file in this commit)
I checked this commit on another machine and can't see diff there either.
I wonder if the ability to display diff might depend on whether the sol file is badly formatted / would not compile / etc.
Due to the fact that I treat this repository as a commonplace book / cheatsheet, I did not check if everything is compiling on a daily basis. But even if it doesn't compile I don't think it should prevent showing diff(?)

Since this is not something that makes the plugin unusable, please ignore this issue if it is not possible to reproduce it on your side.
However, if you feel this is relevant then I will be happy to provide any further information if needed.

Suddenly I can't see the diffs either. I've been using PHP storm for years, i've made no changes and no updates recently, but as of a few days ago, I get "Error: Cannot show diff". Really makes local history worthless....