cursive-ide / cursive

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

Methods in gen-class erroneously flagged as "cannot be resolved" #2892

Open tafenton opened 2 months ago

tafenton commented 2 months ago

Hi,

I work on several applications that use Apache Daemon to run as Windows services; this requires two specific static methods to be defined like so:

(ns my-namespace
  (:gen-class
    :methods [^:static [start ["[Ljava.lang.String;"] void]
              ^:static [stop  ["[Ljava.lang.String;"] void]]))

Cursive adds warning flags to start, stop, and void since can't be resolved, and pops up to that effect during every commit. However, since you can't define a function within a namespace before the ns macro, methods declared this way will never be resolvable. Would a possible solution be to disable this check within the scope of the ns macro?