Twistag / jetbrains-refraction

Jetbrains Plugin for Refraction
https://www.refraction.dev/extensions/jetbrains
MIT License
0 stars 0 forks source link

Utilities don't appear to work when a teamId is present #1

Closed haydenbleasel closed 1 year ago

haydenbleasel commented 1 year ago

Background

Repro Steps

  1. Enter my user and team Id in settings

    CleanShot 2023-04-06 at 12 06 28@2x
  2. Highlight text and choose a tool

    CleanShot 2023-04-06 at 12 06 41@2x
  3. get error message

    CleanShot 2023-04-06 at 12 08 40@2x

stacktrace.txt:

Exceptions occurred on invoking the intention 'Refraction: Add Debug Statements' on a copy of the file.

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.getComponent(ImaginaryEditor.java:78)
    at com.refraction.plugin.intellijrefraction.intentions.MyAbstractIntentionAction.invoke(MyAbstractIntentionAction.java:38)
    at com.refraction.plugin.intellijrefraction.intentions.DebugIntentionAction.invoke(DebugIntentionAction.java:6)
    at com.intellij.codeInsight.intention.IntentionAction.generatePreview(IntentionAction.java:145)
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.invokePreview$lambda$3$lambda$2(IntentionPreviewComputable.kt:146)
    at com.intellij.psi.impl.source.PostprocessReformattingAspect.lambda$postponeFormattingInside$2(PostprocessReformattingAspect.java:140)
    at com.intellij.psi.impl.source.PostprocessReformattingAspect.postponeFormattingInside(PostprocessReformattingAspect.java:148)
    at com.intellij.psi.impl.source.PostprocessReformattingAspect.postponeFormattingInside(PostprocessReformattingAspect.java:139)
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.invokePreview$lambda$3(IntentionPreviewComputable.kt:146)
    at com.intellij.codeInsight.intention.preview.IntentionPreviewUtils.previewSession(IntentionPreviewUtils.java:94)
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.invokePreview(IntentionPreviewComputable.kt:144)
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.generatePreview(IntentionPreviewComputable.kt:103)
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.tryCreateDiffContent$lambda$1(IntentionPreviewComputable.kt:61)
    at com.intellij.model.SideEffectGuard.computeWithAllowedSideEffects(SideEffectGuard.java:25)
    at com.intellij.model.SideEffectGuard.computeWithoutSideEffects(SideEffectGuard.java:18)
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.tryCreateDiffContent(IntentionPreviewComputable.kt:61)
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.call(IntentionPreviewComputable.kt:39)
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable.call(IntentionPreviewComputable.kt:34)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor.callWrapped(NonBlockingReadActionImpl.java:746)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor$MonitoredComputation.call(NonBlockingReadActionImpl.java:778)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:573)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$3(NonBlockingReadActionImpl.java:537)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1111)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:71)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:63)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:128)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:109)
    at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:68)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
    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.executeProcessUnderProgress(CoreProgressManager.java:603)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
    at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:68)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:106)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:71)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:537)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:444)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
    at java.base/java.lang.Thread.run(Thread.java:833)
toptaltkech17 commented 1 year ago

@haydenbleasel 1) is it happening for every method? 2) does it still happen if you right click on the selected text and use the tool that way? 3) which version of intellij are you using?

haydenbleasel commented 1 year ago
  1. Yep, happening on every method
  2. Yep, happens if I right-click selected text > Refraction > [utility]
  3. IntelliJ IDEA 2022.3.3 (Community Edition)
haydenbleasel commented 1 year ago

Update: this seems to occur only if I've entered a teamId. If I remove the teamId it works fine.

toptaltkech17 commented 1 year ago

Update: this seems to occur only if I've entered a teamId. If I remove the teamId it works fine.

That is really strange. I would never think it was because of that. I'll have a look at it.

BTW, I did not test using teamId on my side

haydenbleasel commented 1 year ago

@toptaltkech17 I'll add you to a team so you can test this.

toptaltkech17 commented 1 year ago

@haydenbleasel In the picture I see that you use the same id for user and for the team. is it correct?

haydenbleasel commented 1 year ago

@toptaltkech17 🤦‍♀️ No that's definitely not correct, turns out my copy-to-clipboard on the website has a bug in it, so I copied the wrong team id. Looks like it's working now so I'll close this issue.

toptaltkech17 commented 1 year ago

@haydenbleasel Yeap, I experienced that as well