cursive-ide / cursive

Cursive: The IDE for beautiful Clojure code
588 stars 7 forks source link

IDE will not resolve symbols, but the module builds and runs #328

Open ruttenberg opened 10 years ago

ruttenberg commented 10 years ago

;The all-caps names in the code below cannot be resolved. However, the code compiles and runs.

(ns com.theladders.storm-manage-bluehornet-subscriber.main
  (:import [backtype.storm StormSubmitter LocalCluster])
  (:require
    [ com.theladders.storm-manage-bluehornet-subscriber.topology :as topology]
            [ com.theladders.storm-manage-bluehornet-subscriber.configuration :as configuration])
  (:use [backtype.storm clojure config])
  (:gen-class))

(defn run-local! []
  (let [cluster (LocalCluster.)
        conf (configuration/mk-environmentalized-config)]
    (.submitTopology cluster 
                     "bluehornet-add-subscriber"
                     {TOPOLOGY-DEBUG true
                      TOPOLOGY-WORKERS (configuration/topology-workers conf)
                      TOPOLOGY-ACKER-EXECUTORS (configuration/topology-ackers conf)
                      TOPOLOGY-MAX-SPOUT-PENDING (:spout-parallelism-hint conf)
                      TOPOLOGY-MESSAGE-TIMEOUT-SECS configuration/TUPLE-TIME-TO-LIVE-SEC}
                     (topology/mk-topology)
                     )))

(defn submit-topology! [name]
  (let [conf (configuration/mk-environmentalized-config)] 
    (StormSubmitter/submitTopology
     name
     {TOPOLOGY-WORKERS (configuration/topology-workers conf)
      TOPOLOGY-ACKER-EXECUTORS (configuration/topology-ackers conf)
      TOPOLOGY-MAX-SPOUT-PENDING (:spout-parallelism-hint conf)
      TOPOLOGY-MESSAGE-TIMEOUT-SECS configuration/TUPLE-TIME-TO-LIVE-SEC}
     (topology/mk-topology)
     )))

(defn -main
  ([]
   (run-local!))
  ([name]
   (submit-topology! name)))
cursive-ide commented 10 years ago

Yes, I believe Storm does some macro magic there to map configuration items to symbols. I'll see what I can do with that.

danielcompton commented 9 years ago

This is related to #147, and can probably be closed.

cursive-ide commented 9 years ago

I'll leave this open for the moment, it can be moved to the repo for library support when it exists.