private static @Nullable SelectInContext createDescriptorContext(OpenFileDescriptor descriptor) {
    VirtualFile file = descriptor.getFile();
    Document document = !file.isValid() ? null : FileDocumentManager.getInstance().getDocument(file);
    if (document == null) return null;
    PsiFile psiFile = PsiDocumentManager.getInstance(descriptor.getProject()).getPsiFile(document);
    if (psiFile == null) return null;
    return new SmartSelectInContext(psiFile, psiFile, () -> {
      descriptor.navigate(false);
      List<FileEditor> allEditors = FileEditorManager.getInstance(descriptor.getProject()).getAllEditorList(descriptor.getFile());
      return ContainerUtil.getFirstItem(allEditors);
    });
  }
private static @Nullable SelectInContext createDescriptorContext(OpenFileDescriptor descriptor)