File tree 5 files changed +31
-2
lines changed
java/ee/carlrobert/codegpt
kotlin/ee/carlrobert/codegpt/util/coroutines
5 files changed +31
-2
lines changed Original file line number Diff line number Diff line change
1
+ package ee.carlrobert.codegpt.actions.toolwindow
2
+
3
+ import com.intellij.openapi.actionSystem.AnAction
4
+ import com.intellij.openapi.actionSystem.AnActionEvent
5
+ import com.intellij.openapi.project.Project
6
+ import ee.carlrobert.codegpt.toolwindow.chat.ChatToolWindowContentManager
7
+
8
+ class ClearChatTagsAction : AnAction () {
9
+
10
+ override fun actionPerformed (event : AnActionEvent ) {
11
+ val project: Project = event.project ? : return
12
+ project.getService(ChatToolWindowContentManager ::class .java).clearAllTags()
13
+ }
14
+ }
Original file line number Diff line number Diff line change @@ -138,4 +138,8 @@ private Optional<Content> tryFindFirstChatTabContent() {
138
138
.filter (content -> "Chat" .equals (content .getTabName ()))
139
139
.findFirst ();
140
140
}
141
- }
141
+
142
+ public void clearAllTags () {
143
+ tryFindActiveChatTabPanel ().ifPresent (ChatToolWindowTabPanel ::clearAllTags );
144
+ }
145
+ }
Original file line number Diff line number Diff line change @@ -244,6 +244,10 @@ public void sendMessage(
244
244
});
245
245
}
246
246
247
+ public void clearAllTags () {
248
+ tagManager .clear ();
249
+ }
250
+
247
251
public void includeFiles (List <VirtualFile > referencedFiles ) {
248
252
userInputPanel .includeFiles (referencedFiles );
249
253
totalTokensPanel .updateReferencedFilesTokens (
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import kotlinx.coroutines.*
5
5
import kotlin.coroutines.CoroutineContext
6
6
7
7
internal class DisposableCoroutineScope (
8
- scopeDispatcher : CoroutineDispatcher = Dispatchers . Main .immediate
8
+ scopeDispatcher : CoroutineDispatcher = EdtDispatchers . Default
9
9
) : Disposable, CoroutineScope {
10
10
11
11
private val coroutineScope = CoroutineScope (SupervisorJob () + scopeDispatcher)
Original file line number Diff line number Diff line change 141
141
description =" Creates a new chat session" >
142
142
<keyboard-shortcut keymap =" $default" first-keystroke =" ctrl alt shift N" replace-all =" true" />
143
143
</action >
144
+ <action
145
+ id =" CodeGPT.ClearTags"
146
+ class =" ee.carlrobert.codegpt.actions.toolwindow.ClearChatTagsAction"
147
+ text =" Clear Tags"
148
+ description =" Clear all files tags in active chat" >
149
+ <keyboard-shortcut keymap =" $default" first-keystroke =" ctrl alt shift T" replace-all =" true" />
150
+ </action >
144
151
<action
145
152
id =" CodeGPT.ContextMenuEditCodeAction"
146
153
text =" Edit Code"
You can’t perform that action at this time.
0 commit comments