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:
Phil 2024-04-18 17:49:04 +02:00 committed by GitHub
parent 29b36c52f8
commit 9666590cb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 5 deletions

View file

@ -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);