cursive-ide / cursive

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

defmethod parse broken if fn-tail contains fn name #899

Open ul opened 9 years ago

ul commented 9 years ago

When (defmethod foo :default bar [x] "return me") is used, Cursive highlights both bar and x as “cannot be resolved”. But it is valid (and sometimes useful) form of defmethod: http://clojuredocs.org/clojure.core/defmethod#example-542692c7c026201cdc3269cd

axelarge commented 4 years ago

This would be great to have, otherwise to get decent stack traces with multimethods, an intermediate function has to be manually created. Is there any way to do a workaround using "resolve as.." ?

p-himik commented 4 years ago

Apart from being useful for getting decent stack traces, it's also vital when using multi-arity multimethods:

(defmethod foo :default bar
  ([x] (bar x "hello"))
  ([x y] (println x y)))