cursive-ide / cursive

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

Inlining a variable removes metadata from the following variable, if present #2915

Open cursive-ide opened 3 months ago

cursive-ide commented 3 months ago

For example, when inlining dir in this snippet:

(let [dir (jio/file "/Users/colin")
      ^FileFilter ff (fn [f] true)]
  (.listFiles dir ff))
cursive-ide commented 1 month ago

It also removes comments, in this case preceding when inlining title:

    (let [{:keys [display-name]} @state
          startup-progress-promise (promise)
          ; We basically just start this task to get a progress indicator - this is a bit crap, but the
          ; proper fix requires migrating to Kotlin & coroutines
          title (str "Starting " display-name)
          startup-progress-task (task/backgroundable project title false
                                  (fn [indicator]
                                    (progress/indeterminate indicator true)
                                    (let [settings (ClojureIdeSettings/getInstance)]
                                      (deref startup-progress-promise (* (.replTimeout settings) 1000) nil))))]
      (task/queue startup-progress-task)
      (swap! state assoc :startup-progress-promise startup-progress-promise))