-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter non file urls from classpath response #667
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,17 @@ | |
(:require | ||
[cider.nrepl.middleware.util.error-handling :refer [with-safe-transport]] | ||
[clojure.java.io :as io] | ||
[orchard.java.classpath :as cp])) | ||
[orchard.java.classpath :as cp] | ||
[orchard.misc :as misc])) | ||
|
||
(defn file-url? | ||
[u] | ||
(and (misc/url? u) | ||
(= (.getProtocol ^java.net.URL u) "file"))) | ||
|
||
(defn classpath-reply [msg] | ||
{:classpath (->> (cp/classpath) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've also been thinking we can just add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if that would filter out too much for other clients of orchard. Maybe some clients want to fix this problem instead of just removing the classpath entries which causes this function to fail. Would it not take that possibility from them if we filter on the orchard side? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, adding the function there wouldn't mean that people are forced to use it. It simply seems to me like something that's generally useful outside |
||
(filter file-url?) | ||
(map io/as-file) | ||
(map str))}) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, doesn't it make more sense for this to be in
orchard
as well? Or at least a private function here?