mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-21 02:11:29 +00:00
feat: clear chat tag by keyboard shortcut (#946)
* Added a keyboard shortcut to remove tags from an active chat * Replace Main.immediate dispatcher to EdtDispatcher --------- Co-authored-by: alexander.korovin <alexander.korovin@vk.team>
This commit is contained in:
parent
c7308a4512
commit
c41f2fd2e9
5 changed files with 31 additions and 2 deletions
|
|
@ -0,0 +1,14 @@
|
|||
package ee.carlrobert.codegpt.actions.toolwindow
|
||||
|
||||
import com.intellij.openapi.actionSystem.AnAction
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.project.Project
|
||||
import ee.carlrobert.codegpt.toolwindow.chat.ChatToolWindowContentManager
|
||||
|
||||
class ClearChatTagsAction : AnAction() {
|
||||
|
||||
override fun actionPerformed(event: AnActionEvent) {
|
||||
val project: Project = event.project ?: return
|
||||
project.getService(ChatToolWindowContentManager::class.java).clearAllTags()
|
||||
}
|
||||
}
|
||||
|
|
@ -138,4 +138,8 @@ public final class ChatToolWindowContentManager {
|
|||
.filter(content -> "Chat".equals(content.getTabName()))
|
||||
.findFirst();
|
||||
}
|
||||
}
|
||||
|
||||
public void clearAllTags() {
|
||||
tryFindActiveChatTabPanel().ifPresent(ChatToolWindowTabPanel::clearAllTags);
|
||||
}
|
||||
}
|
||||
|
|
@ -244,6 +244,10 @@ public class ChatToolWindowTabPanel implements Disposable {
|
|||
});
|
||||
}
|
||||
|
||||
public void clearAllTags() {
|
||||
tagManager.clear();
|
||||
}
|
||||
|
||||
public void includeFiles(List<VirtualFile> referencedFiles) {
|
||||
userInputPanel.includeFiles(referencedFiles);
|
||||
totalTokensPanel.updateReferencedFilesTokens(
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import kotlinx.coroutines.*
|
|||
import kotlin.coroutines.CoroutineContext
|
||||
|
||||
internal class DisposableCoroutineScope(
|
||||
scopeDispatcher: CoroutineDispatcher = Dispatchers.Main.immediate
|
||||
scopeDispatcher: CoroutineDispatcher = EdtDispatchers.Default
|
||||
) : Disposable, CoroutineScope {
|
||||
|
||||
private val coroutineScope = CoroutineScope(SupervisorJob() + scopeDispatcher)
|
||||
|
|
|
|||
|
|
@ -129,6 +129,13 @@
|
|||
description="Creates a new chat session">
|
||||
<keyboard-shortcut keymap="$default" first-keystroke="ctrl alt shift N" replace-all="true"/>
|
||||
</action>
|
||||
<action
|
||||
id="CodeGPT.ClearTags"
|
||||
class="ee.carlrobert.codegpt.actions.toolwindow.ClearChatTagsAction"
|
||||
text="Clear Tags"
|
||||
description="Clear all files tags in active chat">
|
||||
<keyboard-shortcut keymap="$default" first-keystroke="ctrl alt shift T" replace-all="true"/>
|
||||
</action>
|
||||
<action
|
||||
id="CodeGPT.ContextMenuEditCodeAction"
|
||||
text="Edit Code"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue