mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-19 07:54:46 +00:00
feat: add include file in context to editor context menu (#475)
* feat: add include file in context to editor context menu * fix: custom title for IncludeFilesInContextAction in editor context menu
This commit is contained in:
parent
29b36c52f8
commit
9666590cb1
3 changed files with 8 additions and 5 deletions
|
|
@ -52,6 +52,10 @@ public class IncludeFilesInContextAction extends AnAction {
|
|||
super(CodeGPTBundle.get("action.includeFilesInContext.title"));
|
||||
}
|
||||
|
||||
public IncludeFilesInContextAction(String customTitleKey) {
|
||||
super(CodeGPTBundle.get(customTitleKey));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||
var project = e.getProject();
|
||||
|
|
@ -93,11 +97,6 @@ public class IncludeFilesInContextAction extends AnAction {
|
|||
}
|
||||
|
||||
private @Nullable FileCheckboxTree getCheckboxTree(DataContext dataContext) {
|
||||
var psiElement = CommonDataKeys.PSI_ELEMENT.getData(dataContext);
|
||||
if (psiElement != null) {
|
||||
return new PsiElementCheckboxTree(psiElement);
|
||||
}
|
||||
|
||||
var selectedVirtualFiles = VIRTUAL_FILE_ARRAY.getData(dataContext);
|
||||
if (selectedVirtualFiles != null) {
|
||||
return new VirtualFileCheckboxTree(selectedVirtualFiles);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.intellij.openapi.extensions.PluginId;
|
|||
import com.intellij.openapi.project.Project;
|
||||
import ee.carlrobert.codegpt.CodeGPTKeys;
|
||||
import ee.carlrobert.codegpt.ReferencedFile;
|
||||
import ee.carlrobert.codegpt.actions.IncludeFilesInContextAction;
|
||||
import ee.carlrobert.codegpt.conversations.message.Message;
|
||||
import ee.carlrobert.codegpt.settings.configuration.ConfigurationSettings;
|
||||
import ee.carlrobert.codegpt.toolwindow.chat.ChatToolWindowContentManager;
|
||||
|
|
@ -75,6 +76,8 @@ public class EditorActionsUtil {
|
|||
};
|
||||
group.add(action);
|
||||
});
|
||||
group.addSeparator();
|
||||
group.add(new IncludeFilesInContextAction("action.includeFileInContext.title"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue