Skip to content

Commit c110e0c

Browse files
committed
fix: Remove redundant code and optimize tool window content creation
1 parent 4c442df commit c110e0c

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

core/src/main/kotlin/cc/unitmesh/devti/gui/AutoDevToolWindowFactory.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ class AutoDevToolWindowFactory : ToolWindowFactory, DumbAware {
2828
val chatPanel = ContentFactory.getInstance().createContent(contentPanel, "AutoDev Chat", false).apply {
2929
setInitialDisplayName(this)
3030
}
31-
32-
contentPanel.resetChatSession()
31+
32+
contentPanel.resetChatSession()
3333
initInlineChatForIdea223(project)
3434

35-
ApplicationManager.getApplication().invokeLater {
35+
ApplicationManager.getApplication().invokeLater {
3636
toolWindow.contentManager.addContent(chatPanel)
3737

3838
val hasSketch =

core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ChatCodingPanel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class ChatCodingPanel(private val chatCodingService: ChatCodingService, val disp
269269
}
270270
}
271271

272-
messageView.reRenderAssistantOutput()
272+
// messageView.reRenderAssistantOutput()
273273
return text
274274
}
275275

core/src/main/kotlin/cc/unitmesh/devti/gui/toolbar/NewChatAction.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@ class NewChatAction : DumbAwareAction(), CustomComponentAction {
3939

4040
val codingPanel =
4141
contentManager?.component?.components?.filterIsInstance<ChatCodingPanel>()?.firstOrNull()
42-
AutoDevToolWindowFactory().createToolWindowContent(project, toolWindowManager!!)
42+
43+
AutoDevToolWindowFactory().createToolWindowContent(project, toolWindowManager)
4344
if (codingPanel == null) {
44-
// AutoDevToolWindowFactory().createToolWindowContent(project, toolWindowManager)
4545
return@addActionListener
4646
}
4747

48-
// change content displayName AutoDevBundle.message("autodev.chat")
4948
contentManager.contents.filter { it.component is ChatCodingPanel }.forEach {
5049
AutoDevToolWindowFactory.setInitialDisplayName(it)
5150
}

0 commit comments

Comments
 (0)