docs: public static IMarker getMarkerFromEditor(ITextSelection selection, IEditorPart editor) {
          IResource resource = (IResource) editor.getEditorInput().getAdapter(IFile.class);
          IMarker[] allMarkers;
          if (resource != null) {
              allMarkers = getMarkers(resource, IResource.DEPTH_ZERO);
          } else {
              IClassFile classFile = (IClassFile) editor.getEditorInput().getAdapter(IClassFile.class);
              if (classFile == null) {
                  return null;
              }
              Set<IMarker> markers = getMarkers(classFile.getType());
              allMarkers = markers.toArray(new IMarker[markers.size()]);
          }
          // if editor contains only one FB marker, do some cheating and always
          // return it.
          if (allMarkers.length == 1) {
              return allMarkers[0];
          }
          // +1 because it counts real lines, but editor shows lines + 1
          int startLine = selection.getStartLine() + 1;
          for (IMarker marker : allMarkers) {
              int line = getEditorLine(marker);
              if (startLine == line) {
                  return marker;
              }
          }
          return null;
      }