   ([bundle type-def]
     (b/remove-extension! (eclipse-type-id (:type-id type-def)))
     (let [ext-str (as-extension type-def)]
+      #_(e/info-dialog "ccw.api.markers" (str "create extension for " type-def ": " ext-str))
       (b/add-contribution!
         (or (:name type-def) (eclipse-type-id (:type-id type-def)))
         ext-str

    (.deleteMarkers
      (e/resource resource)
      (eclipse-type-id type-id) ; it is ok to call deleteMarkers with type-id set to nil (delete all markers)
      include-subtypes
      (depth-map depth depth))))

(defn- reset-marker-manager-cache!
  "The Eclipse Marker API does not dynamically update its marker type list when

      :char-start 0 :char-end 1
      :message \"Dynamically created, how cool is that?\"})"
  [resource marker-map]
  #_(e/info-dialog "ccw.api.markers" (str "create-marker! " resource ", " marker-map))
  (let [type-id (eclipse-type-id (:type-id marker-map))
        attrs (java.util.HashMap.)]
     (doseq [[k v] (dissoc marker-map :type-id)
             :let [f (keyword-to-attr-key k)]]
       (f attrs v))
     #_(e/info-dialog "markers" (str "type id:" type-id))
     #_(e/info-dialog "markers" (str "attrs:" (str attrs)))
     (MarkerUtilities/createMarker
       (e/resource resource)
       attrs
       type-id)))

(defn marker-map
  "Retrieves the marker map from an eclipse marker."
  [marker]
  (let [m {:type-id (MarkerUtilities/getMarkerType marker)}
        attrs (.getAttributes marker)]
    (into m (map (fn [[k v]] ((attr-key-to-keyword k) v)) attrs))))

(defn marker-into!
  "Adds all attributes in attrs-map to the eclipse marker.
   It's not possible to change the type id. If it is set, it will be ignored
   Returns the eclipse marker."
  [marker attrs-map]
  (let [attrs (java.util.HashMap.)]
     (doseq [[k v] (dissoc attrs-map :type-id)
             :let [f (keyword-to-attr-key k)]]
       (f attrs v))
     (doto marker
       (.setAttributes (into-array String (keys attrs)) (into-array Object (vals attrs))))))

(defn delete-markers!
  "Delete markers for the resource.
