-
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
Add a option for filtering vars to the ns-vars middleware #605
Conversation
3608c07
to
0a5a634
Compare
src/cider/nrepl/middleware/ns.clj
Outdated
(u/update-keys name) | ||
(into (sorted-map)))) | ||
(defn ns-vars-clj [ns & [include-privates?]] | ||
(let [fetch-vars (if include-privates? |
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.
We can also use var-query
here directly. That would simplify a bit the code.
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.
Thank you for reviewing!
I missed var-query
API. I'll fix.
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.
@bbatsov Fixed!
If we have orchard.query/vars
for clojurescript, I think it seems better to use var-query API like test-var-query
op.
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.
We don't have it yet (something that @arichiardi can probably tackle), but I think we can still adopt the same API and just "fake" it on the cljs side for now (by ignoring everything but the private filter).
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.
@bbatsov OK! I fixed to take var-query
option for filtering vars.
On the cljs side, it only support private?
query currently.
The PR looks good overall. I mostly wonder if we should try to use here the var-query API, as this would give more flexibility to the ns filtering in general. |
0a5a634
to
e1cb0af
Compare
Codecov Report
@@ Coverage Diff @@
## master #605 +/- ##
========================================
Coverage ? 76.5%
========================================
Files ? 37
Lines ? 2409
Branches ? 128
========================================
Hits ? 1843
Misses ? 438
Partials ? 128
Continue to review full report at Codecov.
|
e1cb0af
to
9964b4c
Compare
9964b4c
to
0431a95
Compare
Fantastic work! Thanks! 🙇 |
A newbie question on this, what is the difference between this The kind of seem redundant but maybe |
I was referring to https://github.com/clojure-emacs/orchard/blob/master/src/orchard/query.clj How is |
Oh ok it is a different use case...I was just wondering if |
Fix #566.