cursive icon indicating copy to clipboard operation
cursive copied to clipboard

Organize imports removes used namespaces on CLJC

Open wilkerlucio opened this issue 2 years ago • 0 comments

Hello, I found an issue when using organize imports in cljc files. Here is an example:

(ns some-namespace
  (:require [clojure.test :refer [deftest is]]))

#?(:cljs
 (deftest some-test
   (is (= 1 2))))

When I run organize imports, Cursive removes the :refer parts because it considers it was not used (causing the code to break), but it is used, just not on CLJ. So seems like Cursive should be checking both clj and cljs separately, and only if any does not use it, then should it be removed.

wilkerlucio avatar Aug 12 '22 17:08 wilkerlucio