Skip to content

Commit

Permalink
Also consider cljc files for namespaces-on-classpath
Browse files Browse the repository at this point in the history
  • Loading branch information
eval committed Jun 15, 2023
1 parent 42c4c1d commit b093f6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Complete fully-qualified classnames by their shortname prefix anywhere in the
file (previously worked only in the `:import` section of the `ns` form).
- Fix ' and #' being swallowed when completing vars prefixed by them.
- [#91](https://github.com/alexander-yakushev/compliment/pull/91): Also consider cljc files for namespaces-on-classpath

### 0.3.14 (2022-07-11)

Expand Down
5 changes: 3 additions & 2 deletions src/compliment/utils.clj
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Note that should always have the same value, regardless of OS."
(let [classpath (classpath)]
(cache-last-result ::namespaces-on-classpath classpath
(set (for [^String file (all-files-on-classpath classpath)
:when (and (.endsWith file ".clj")
:when (and (or (.endsWith file ".clj") (.endsWith file ".cljc"))
(not (.startsWith file "META-INF")))
:let [[_ ^String nsname] (re-matches #"[^\w]?(.+)\.clj" file)]
:when nsname]
Expand All @@ -208,7 +208,8 @@ Note that should always have the same value, regardless of OS."
(cache-last-result ::project-resources classpath
(for [path classpath
^String file (list-files path false)
:when (not (or (empty? file) (.endsWith file ".clj")
:when (not (or (empty? file)
(.endsWith file ".clj") (.endsWith file ".cljc")
(.endsWith file ".jar") (.endsWith file ".class")))]
;; resource pathes always use "/" regardless of platform
(.. (if (.startsWith file File/separator)
Expand Down

0 comments on commit b093f6a

Please sign in to comment.