eerohele / Tutkain

A Sublime Text package for interactive Clojure development
https://tutkain.flowthing.me
Other
68 stars 8 forks source link

Suggest unloaded namespaces for auto-completion #100

Open eerohele opened 2 years ago

eerohele commented 2 years ago

Something like this:

(def classpath-nses
  (delay
    (into (sorted-set)
      (comp
        (mapcat path-files)
        (filter #(or (string/ends-with? % ".clj") (string/ends-with? % ".cljc")))
        (remove #(string/starts-with? % "META-INF"))
        (map #(subs % 0 (.lastIndexOf ^String % ".")))
        (map #(if (string/starts-with? % "/") (subs % 1) %))
        (map #(string/replace % "/" "."))
        (map #(string/replace % "_" "-"))
        (map symbol))
      (.split (System/getProperty "java.class.path") File/pathSeparator))))