intellij-ideaclojurecursive

Cursive/Intellij - undefined step_definitions warning


I am using lein-cucumber to write cucumber tests. My test suit executes without any errors, but my IDE flags these warnings:

enter image description here enter image description here

I have installed the plug-ins: cursive, cucumber and gherkin into Intellij. But these warnings are still shown.

This is my project.clj file:

(defproject app version
  :dependencies [
  [org.clojure/clojure "1.8.0"]
  [org.clojure/tools.logging "0.4.0"]
  [org.clojure/tools.cli "0.3.5"]
  [org.clojure/data.json "0.2.6"]
  [clj-http "3.9.1"]
  [mysql/mysql-connector-java "5.1.38"]
  [org.slf4j/slf4j-log4j12 "1.7.25"]
  [log4j/log4j "1.2.17" :exclusions [javax.mail/mail
  javax.jms/jms
  com.sun.jmdk/jmxtools
  com.sun.jmx/jmxri]]
  [metosin/compojure-api "1.1.11"]
  [metosin/ring-swagger "0.24.3"]
  [compojure "1.6.0"]
  [cheshire "5.8.0"]
  [ring "1.6.3"]
  [ring/ring-json "0.4.0"]
  [ring-logger "0.7.7"]
  [environ "1.1.0"]
  [korma "0.4.3"]
  [blackwater "0.0.9"]
  [prismatic/schema "1.1.7"]
  [siili/humanize "0.1.1"]
  [amazonica "0.3.117"]
  [clj-time "0.14.2"]
  [ring-cors "0.1.12"]
  [commons-io "2.0"]
  ]

  :plugins      [
  [lein-ring "0.12.1"]
  [lein-cucumber "1.0.2"]
  [lein-cloverage "1.0.10"]
  [lein-kibit "0.1.6"]
  [lein-cloverage "1.0.10"]
  [lein-try "0.4.3"]
  [nightlight/lein-nightlight "1.0.0"]
  [jonase/eastwood "0.2.3"]
  [cider/cider-nrepl "0.16.0"]
  ]

  :min-lein-version "2.5.3"

  :ring {:handler app.api.handler/app}

  :source-paths ["src"]

  :resource-paths ["resources"]

  :test-paths ["test/unit"
  "test/features"]

  :cucumber-feature-paths ["test/features"]

  :profiles {:uberjar {:aot :all}}
  )

Solution

  • This can happen when using a library that defines vars/functions dynamically. Cursive can't discover those definitions because it would require evaluating the code that generates the definitions.

    This appears to be the case seeing how Given is defined. I've also seen this with libraries like Amazonica that generate definitions based on AWS SDK.