    :message     (fn [m v] (MarkerUtilities/setMessage m v))
    :severity    (fn [m v] (.put m IMarker/SEVERITY (severity v v)))})
 
-(def ^:private type-map
+(def ^:private type-ids
   "Map containing standard eclipse marker types, as well as those provided
    by ccw by default."
-  {:ccw ccw.builder.ClojureBuilder/CLOJURE_COMPILER_PROBLEM_MARKER_TYPE
-   :marker IMarker/MARKER ; base marker
-   :problem IMarker/PROBLEM
-   :task IMarker/TASK
-   :text IMarker/TEXT
-   :bookmark IMarker/BOOKMARK})
+  {:marker   IMarker/MARKER ; base marker
+   :problem  IMarker/PROBLEM
+   :task     IMarker/TASK
+   :text     IMarker/TEXT
+   :bookmark IMarker/BOOKMARK
+   :ccw      ccw.builder.ClojureBuilder/CLOJURE_COMPILER_PROBLEM_MARKER_TYPE
+   :all      nil})
 
 (def depth-map
   "Used to declare how deep below a given resource (a project or a folder,

   Example:
   (ma/create-marker!
     (e/workspace-resource \"ccw.core/src/clj/ccw/api/markers.clj\")
     {:type \"ccw-plugin-xyz\"
      :severity :error
      :char-start 0 :char-end 1
      :message \"Dynamically created, how cool is that?\"})"
  [resource marker-map]
  (let [type (type-map (:type marker-map)
               (if-not (.contains (:type marker-map) ".")
                 (str (.getSymbolicName (b/bundle "ccw.core")) "." (:type marker-map))
                 (:type marker-map)))
        attrs (java.util.HashMap.)]
     (doseq [[k v] (dissoc marker-map :type)]
       (let [f (keyword-to-attr-key k)]
         (f attrs v)))
     (MarkerUtilities/createMarker
       (e/resource resource)
       attrs
       type)))

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

          deep below it should the deletion broaden."
  ([resource]
    (delete-markers! resource nil))
  ([resource type-id]
    (delete-markers! resource type-id true))
  ([resource type-id include-subtypes]
    (delete-markers! resource type-id include-subtypes :infinite))
  ([resource type-id include-subtypes depth]
    (.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))))

