cursive-ide / cursive

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

Implementing methods of a protocol doesn't quite work #767

Open yatesco opened 9 years ago

yatesco commented 9 years ago

Given a protocol:

(ns health.server.command-bus
(defprotocol IServe
  (can-serve? [this cmd])
  (serve [this cmd]))

and

(ns blah
  (:require [health.server.command-bus :as command-bus]))

(defrecord Name [fields]
  command-bus/IServe<CURSOR HERE>)

then "Implement methods (apple I)" of the IServe protocol gives:

(ns blah
  (:require [health.server.command-bus :as command-bus])
  (:import (health.server.command_bus IServe)))

(defrecord Name [fields]
  command-bus/IServe
  IServe
  (can_serve_QMARK_ [this cmd]
    )
  (serve [this cmd]
    )) ```

note the duplicate unqualified IServe and the weird import of the class.
hlship commented 9 years ago

Ah, hit this myself (in 0.1.50). Here's another example:

fullscreen_3_17_15__10_25_am