Skip to content

Commit

Permalink
[IJ Plugin] Do not use internal symbol (#6255)
Browse files Browse the repository at this point in the history
  • Loading branch information
BoD authored Nov 13, 2024
1 parent faa8c4a commit 9672b48
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import com.apollographql.ijplugin.util.logd
import com.intellij.lang.jsgraphql.GraphQLFileType
import com.intellij.openapi.Disposable
import com.intellij.openapi.actionSystem.ActionManager
import com.intellij.openapi.actionSystem.ActionToolbar
import com.intellij.openapi.actionSystem.DefaultActionGroup
import com.intellij.openapi.actionSystem.impl.ActionToolbarImpl
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.invokeLater
import com.intellij.openapi.components.Service
import com.intellij.openapi.fileEditor.FileEditorManager
Expand Down Expand Up @@ -43,8 +44,10 @@ class SandboxService(
object : FileEditorManagerListener {
override fun fileOpened(source: FileEditorManager, file: VirtualFile) {
logd("$file")
invokeLater {
addOpenInSandboxAction(file)
ApplicationManager.getApplication().executeOnPooledThread {
invokeLater {
addOpenInSandboxAction(file)
}
}
}
}
Expand All @@ -62,7 +65,7 @@ class SandboxService(

// XXX This is fragile as it tightly relies on how the header component's UI is built by the GraphQL Plugin
val onePixelSplitter = existingEditorHeaderComponent.components?.firstIsInstanceOrNull<OnePixelSplitter>() ?: return
val actionToolbar = onePixelSplitter.secondComponent as? ActionToolbarImpl ?: return
val actionToolbar = onePixelSplitter.secondComponent as? ActionToolbar ?: return
val actionGroup = actionToolbar.actionGroup as? DefaultActionGroup ?: return

if (actionGroup.getChildActionsOrStubs().none { it is OpenInSandboxAction }) {
Expand Down

0 comments on commit 9672b48

Please sign in to comment.