sourcegraph / jetbrains

Apache License 2.0
54 stars 16 forks source link

bug: com.intellij.codeInsight.intention.impl.preview.IntentionPreviewUnsupportedOperationException: It's unexpected to invoke this... #1480

Closed ceearrashee closed 2 months ago

ceearrashee commented 2 months ago

Cody Version

5.5.9

IDE Information

GoLand 2024.1.1 Build #GO-241.15989.157, built on April 30, 2024 Licensed to Yevhen Androsov Subscription is active until June 4, 2024. Runtime version: 17.0.10+1-b1207.14 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11.0 GC: G1 Young Generation, G1 Old Generation Memory: 4096M Cores: 20 Registry: debugger.new.tool.window.layout=true ide.completion.variant.limit=500 suggest.all.run.configurations.from.context=TRUE ide.experimental.ui=true ide.images.show.chessboard=true terminal.new.ui=true Non-Bundled Plugins: com.jetbrains.plugins.ini4idea (241.15989.113) com.intellij.datagen (241.14494.150) dev.turingcomplete.intellijdevelopertoolsplugins (4.2.0) MultiHighlight (3.1.0) com.intellij.ml.llm (241.15989.156) com.jetbrains.space (241.15989.9) Rider UI Theme Pack (0.14.11) org.intellij.plugins.postcss (241.14494.155) org.jetbrains.plugins.sass (241.14494.155) com.intellij.properties (241.14494.150) String Manipulation (9.13.0) org.turbanov.run.configuration.as.action (3.0) org.OverEngineer.InlineProblems (0.5.2) com.intellij.plugins.github.colorscheme (241.14494.150) hunspell (241.15989.180) xyz.danizz.commit-message-wrapper-fixer (1.2) com.github.camork.fileExpander (2.5) com.wakatime.intellij.plugin (14.3.13) XPathView (241.15989.65) com.intellij.tasks (241.15989.157) com.intellij.tasks.timeTracking (241.14494.150) com.intellij.plugin.adernov.powershell (2.6.1) com.intellij.aqua (241.15989.180) com.intellij.mermaid (0.0.21+IJ.232) com.intellij.kubernetes (241.15989.102) com.intellij.laf.macos (241.14494.150) com.intellij.grazie.pro (0.3.304) com.github.nikolaikopernik.codecomplexity (1.5.0) Dart (241.15989.9) com.github.copilot (1.5.3.5510) io.wisetime.plugins.window.branch (2.0.0) com.virtuslab.git-machete (4.2.1) app.codepreview.plugin (1.2.1) NodeJS (241.15989.20) me.mbolotov.cypress (1.6.2) Karma (241.15989.111) com.dmarcotte.handlebars (241.14494.150) tslint (241.14494.155) AngularJS (241.15989.57) dev.nx.console (1.23.1) intellij.prettierJS (241.15989.111) com.sourcegraph.jetbrains (5.5.9) com.intellij.jira (4.8.0) mobi.hsz.idea.gitignore (4.5.3) com.intellij.queryComplexity (241.14494.150) com.intellij.tide (241.15989.180) com.github.linwancen.drawgraph (1.14.2024.05.08_23.05) codiumai.codiumai (0.7.35) org.jetbrains.plugins.tinygo (0.5.13) com.github.dinbtechit.vscodetheme (1.10.10) com.ypwang.plugin.go-linter (1.6.6) cn.yiiguxing.plugin.translate (3.5.8)

Describe the bug

Regular work

Expected behavior

Regular work

Additional context

Stacktrace:

com.intellij.codeInsight.intention.impl.preview.IntentionPreviewUnsupportedOperationException: It's unexpected to invoke this method on an intention preview calculating.
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewEditor.notImplemented(IntentionPreviewEditor.kt:15)
    at com.intellij.openapi.editor.impl.ImaginaryEditor.getInlayModel(ImaginaryEditor.java:268)
    at com.sourcegraph.cody.autocomplete.render.InlayModelUtil.getAllInlaysForEditor(InlayModelUtil.kt:25)
    at com.sourcegraph.cody.autocomplete.CodyAutocompleteManager.disposeInlays(CodyAutocompleteManager.kt:111)
    at com.sourcegraph.cody.autocomplete.CodyAutocompleteManager.clearAutocompleteSuggestions(CodyAutocompleteManager.kt:84)
    at com.sourcegraph.cody.listeners.CodyDocumentListener.documentChangedNonBulk(CodyDocumentListener.kt:38)
    at com.intellij.openapi.editor.event.BulkAwareDocumentListener.documentChanged(BulkAwareDocumentListener.java:21)
    at jdk.internal.reflect.GeneratedMethodAccessor235.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:119)
    at com.intellij.util.EventDispatcher.lambda$createMulticaster$1(EventDispatcher.java:84)
    at jdk.proxy2/jdk.proxy2.$Proxy97.documentChanged(Unknown Source)
    at com.intellij.openapi.editor.impl.DocumentImpl.lambda$changedUpdate$1(DocumentImpl.java:917)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:269)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:684)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:277)
    at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:53)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:277)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:268)
    at com.intellij.openapi.editor.impl.DocumentImpl.changedUpdate(DocumentImpl.java:914)
    at com.intellij.openapi.editor.impl.DocumentImpl.updateText(DocumentImpl.java:818)
    at com.intellij.openapi.editor.impl.DocumentImpl.replaceString(DocumentImpl.java:658)
    at com.intellij.openapi.editor.impl.DocumentImpl.replaceString(DocumentImpl.java:595)
    at com.intellij.psi.formatter.DocumentBasedFormattingModel.replaceWhiteSpace(DocumentBasedFormattingModel.java:146)
    at com.intellij.formatting.engine.FormatProcessorUtils.replaceWhiteSpace(FormatProcessorUtils.java:31)
    at com.intellij.formatting.engine.ApplyChangesState.doIteration(ApplyChangesState.java:160)
    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.iteration(FormatProcessor.java:92)
    at com.intellij.formatting.FormatterImpl$MyFormattingTask.iteration(FormatterImpl.java:681)
    at com.intellij.formatting.FormatterImpl.execute(FormatterImpl.java:260)
    at com.intellij.formatting.FormatterImpl.format(FormatterImpl.java:228)
    at com.intellij.psi.impl.source.codeStyle.CodeFormatterFacade.processText(CodeFormatterFacade.java:203)
    at com.intellij.formatting.service.CoreFormattingService.formatRanges(CoreFormattingService.java:92)
    at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl$ReformatRangesAction.execute(PostprocessReformattingAspectImpl.java:811)
    at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.lambda$doPostponedFormattingInner$9(PostprocessReformattingAspectImpl.java:422)
    at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.runWithDocCommentFormattingDisabled(CodeStyleManagerImpl.java:508)
    at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.doPostponedFormattingInner(PostprocessReformattingAspectImpl.java:421)
    at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.lambda$doPostponedFormatting$7(PostprocessReformattingAspectImpl.java:298)
    at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.lambda$disablePostprocessFormattingInside$1(PostprocessReformattingAspectImpl.java:119)
    at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.disablePostprocessFormattingInside(PostprocessReformattingAspectImpl.java:128)
    at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.disablePostprocessFormattingInside(PostprocessReformattingAspectImpl.java:118)
    at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.lambda$doPostponedFormatting$8(PostprocessReformattingAspectImpl.java:298)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:269)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:277)
    at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:57)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:277)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:268)
    at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.doPostponedFormatting(PostprocessReformattingAspectImpl.java:296)
    at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.doPostponedFormatting(PostprocessReformattingAspectImpl.java:281)
    at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.decrementPostponedCounter(PostprocessReformattingAspectImpl.java:180)
    at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.postponeFormattingInside(PostprocessReformattingAspectImpl.java:151)
    at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.postponeFormattingInside(PostprocessReformattingAspectImpl.java:138)
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.invokePreview$lambda$2(Intentio...
taylorsperry commented 2 months ago

closing in favor of https://github.com/sourcegraph/jetbrains/issues/1485