clj-refactor.nvim icon indicating copy to clipboard operation
clj-refactor.nvim copied to clipboard

`cram` (add missing libspec) fails if there are no :requires yet

Open daveyarwood opened this issue 7 years ago • 0 comments

If I have a bare-bones namespace declaration like:

(ns foo)

And I move my cursor over something like str/includes? and type cram, I get an error message: nil

If I add in a :require part of the ns form:

(ns foo
  (:require []))

and then do the same thing, then it works.

I would guess that this is something to do with not being able to locate the :require part of the ns (because it doesn't exist yet) and not handling that case specially. I think the right behavior there would be to add the :require form for you.

daveyarwood avatar Jun 01 '18 11:06 daveyarwood