Skip to content

Commit 7cc8365

Browse files
committed
Fix ns-on-cp?
1 parent b4512c6 commit 7cc8365

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* This helps clients avoiding the suggestion/insertion of candidates which are redundant
1111
* e.g. `+` is already interned, so is `Thread`
1212
* same for `:refer`s and `:rename`s
13+
* Fix a bug the newly introduced .cljc detection.
1314

1415
## 3.8.0
1516

src/refactor_nrepl/analyzer.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
(:refer-clojure :exclude [macroexpand-1])
33
(:require
44
[clojure.java.io :as io]
5+
[clojure.string :as string]
56
[clojure.tools.analyzer :as ana]
67
[clojure.tools.analyzer.ast :refer [nodes]]
78
[clojure.tools.analyzer.jvm :as aj]
8-
[clojure.tools.analyzer.jvm.utils :as ajutils]
99
[clojure.tools.namespace.parse :refer [read-ns-decl]]
1010
[clojure.tools.reader :as reader]
1111
[clojure.walk :as walk]
@@ -57,7 +57,8 @@
5757
ast)
5858

5959
(defn- ns-on-cp? [ns]
60-
(io/resource (ajutils/ns->relpath ns)))
60+
(boolean (or (io/resource (-> ns str (string/replace \. \/) (string/replace \- \_) (str ".clj")))
61+
(io/resource (-> ns str (string/replace \. \/) (string/replace \- \_) (str ".cljc"))))))
6162

6263
(defn- shadow-unresolvable-symbol-handler [symbol-ns symbol-name symbol-ast]
6364
{:op :const

0 commit comments

Comments
 (0)