-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
Integrate ns-vars-with-meta op #1710
Conversation
"Return font-lock-face for TEXT. | ||
The var info is fetched from the running repl and a font-lock face is decided. | ||
(defun cider-browse-ns--text-face (var-meta) | ||
"Return font-lock-face for a var. VAR-INFO is its metadata information. |
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.
The docstring will produce checkdoc
warnings.
Overall the changes look good to me. |
Done :-) |
"Return font-lock-face for TEXT. | ||
The var info is fetched from the running repl and a font-lock face is decided. | ||
(defun cider-browse-ns--text-face (var-meta) | ||
"Return font-lock-face for a var. VAR-META is its metadata information. |
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.
The first line of a docstring should be just one sentence.
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.
Done :-)
The current ns-browser relies on the `cider-repl-ns-cache` to decide font-locks. This gives us incorrect font-locks for namespaces which are present on the classpath, but not loaded in the REPL. We change this to get the data from the nREPL middleware op `ns-vars-with-meta`,in case of a cache miss; clojure-emacs/cider-nrepl#346.
|
||
(declare-function cider-resolve-ns-symbols "cider-resolve") | ||
|
||
(defun cider-ns-vars-with-meta (ns) |
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.
I don't think we need this anymore. Now that we have an op that returns exactly what we need, there's no need to use the cache. It complicates the code and has no advantage (now that the real op is fast enough).
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.
This only has an advantage when fetching huge namespaces, like the core ns'. But yeah, this fn could be avoided. I'll submit a PR today.
…aded in the REPL (clojure-emacs#1710) The current ns-browser relies on the `cider-repl-ns-cache` to decide font-locks. This gives us incorrect font-locks for namespaces which are present on the classpath, but not loaded in the REPL. We change this to get the data from the nREPL middleware op `ns-vars-with-meta`,in case of a cache miss; clojure-emacs/cider-nrepl#346.
Before submitting a PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
make test
)M-x checkdoc
warningsThanks!
The current ns-browser relies on the
cider-repl-ns-cache
to decide font-locks.This gives us incorrect font-locks for namespaces which are present on the classpath,
but not loaded in the REPL.
We change this to get the data from the nREPL middleware op
ns-vars-with-meta
,in case of a cache miss; clojure-emacs/cider-nrepl#346.