Skip to content

Commit

Permalink
Fix TreeUI should be accessed only from EDT exception
Browse files Browse the repository at this point in the history
  • Loading branch information
exigow committed Feb 1, 2024
1 parent 759369e commit a1d9262
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.sourcegraph.cody.commands.ui
import com.intellij.openapi.actionSystem.ActionManager
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.DefaultActionGroup
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.openapi.project.DumbAwareAction
import com.intellij.openapi.project.Project
Expand Down Expand Up @@ -33,8 +34,10 @@ class CommandsContextMenu {
CodyEditorFactoryListener.Util.informAgentAboutEditorChange(
it, hasFileChanged = false) {
CodyToolWindowContent.executeOnInstanceIfNotDisposed(project) {
switchToChatSession(
AgentChatSession.createFromCommand(project, commandId))
ApplicationManager.getApplication().invokeLater {
switchToChatSession(
AgentChatSession.createFromCommand(project, commandId))
}
}
}
}
Expand Down

0 comments on commit a1d9262

Please sign in to comment.