    - https://www.eclipse.org/articles/Article-Mark%20My%20Words/mark-my-words.html"
   (:require [ccw.eclipse :as e]
             [ccw.bundle :as b]
-            [ccw.core.trace :as t])
+            [ccw.core.trace :as t]
+            [clojure.set :as set])
   (:import [org.eclipse.ui.texteditor MarkerUtilities]
            [org.eclipse.core.resources IMarker IResource]))
 

      :char-start 0 :char-end 1
      :message \"Dynamically created, how cool is that?\"})"
  [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)))
     (MarkerUtilities/createMarker
       (e/resource resource)
       attrs
       type-id)))

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

   :char-end    (fn [m v] (MarkerUtilities/setCharEnd m v))
   :message     (fn [m v] (MarkerUtilities/setMessage m v))
   :severity    (fn [m v] (.put m IMarker/SEVERITY (severity v v)))})

(def attr-key-to-keyword
  "Standard marker attributes recoginzed by Eclipse.
   :line-number is mutually exclusive with :char-start + :char-end
   :line-number considers first line number is 1
   :char-start / :char-end consider first char is at index 0
   :message must be a string
   :severity must be a keyword from the severity map keys, or a String"
  {IMarker/LINE_NUMBER (fn [v] [:line-number v])
   IMarker/CHAR_START  (fn [v] [:char-start v])
   IMarker/CHAR_END    (fn [v] [:char-end v])
   IMarker/MESSAGE     (fn [v] [:message v])
   IMarker/SEVERITY    (fn [v] [:severity (severity-invert v v)])})

(def ^:private type-ids
  "Map containing standard eclipse marker types, as well as those provided
