Skip to content
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

Merged
merged 1 commit into from
Apr 24, 2016
Merged

Integrate ns-vars-with-meta op #1710

merged 1 commit into from
Apr 24, 2016

Conversation

ckoparkar
Copy link
Contributor

@ckoparkar ckoparkar commented Apr 24, 2016

Before submitting a PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):

  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s)
  • All tests are passing (make test)
  • The new code is not generating bytecode or M-x checkdoc warnings
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the readme (if adding/changing user-visible functionality)
  • You've updated the refcard (if you made changes to the commands listed there)

Thanks!

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.

"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.
Copy link
Member

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.

@bbatsov
Copy link
Member

bbatsov commented Apr 24, 2016

Overall the changes look good to me.

@ckoparkar
Copy link
Contributor Author

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.
Copy link
Member

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.

Copy link
Contributor Author

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.
@bbatsov bbatsov merged commit 9991c35 into clojure-emacs:master Apr 24, 2016

(declare-function cider-resolve-ns-symbols "cider-resolve")

(defun cider-ns-vars-with-meta (ns)
Copy link
Member

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).

Copy link
Contributor Author

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.

ajchemist pushed a commit to ajchemist/cider that referenced this pull request Apr 25, 2016
…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.
@ckoparkar ckoparkar deleted the feature/ns-browser branch April 25, 2016 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants