private static @Nullable VirtualFile getEditorFile(@NotNull DataContext context) {
    Project project = context.getData(CommonDataKeys.PROJECT);
    if (project == null) return null;
    VirtualFile[] selectedFiles = FileEditorManager.getInstance(project).getSelectedFiles();
    if (selectedFiles.length == 0) return null;
    VirtualFile selectedFile = selectedFiles[0];
    if (!selectedFile.isInLocalFileSystem()) return null;
    return selectedFile;
  }
private static @Nullable VirtualFile getEditorFile(@NotNull DataContext context)