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

Honor clojure.tools.namespace config and conventions #503

Merged
merged 1 commit into from Feb 10, 2018

Conversation

plexus
Copy link
Contributor

@plexus plexus commented Feb 9, 2018

There are two things here: honor set-refresh-dirs, and honor ::load metadata.

The directories to scan for a refresh can be configured with
clojure.tools.namespace/set-refresh-dirs. This makes CIDER honor this
configuration when set.

Specific namespaces can be excluded from being loaded or unloaded by setting
metadata on the namespace, for which there are convenience methods in
clojure.tools.namespace.repl. The docstrings of these methods say that setting
:clojure.tools.namespace.repl/load false should imply
:clojure.tools.namespace.repl/unload false. This makes CIDER honor that
convention.

Before submitting a PR make sure the following things have been done:

  • The commits are consistent with our contribution guidelines
  • You've added tests to cover your change(s)
  • All tests are passing
  • The new code is not generating reflection warnings
  • You've updated the readme (if adding/changing middleware)

Thanks!

The directories to scan for a refresh can be configured with
`clojure.tools.namespace/set-refresh-dirs`. This makes CIDER honor this
configuration when set.

Specific namespaces can be excluded from being loaded or unloaded by setting
metadata on the namespace, for which there are convenience methods in
clojure.tools.namespace.repl. The docstrings of these methods say that setting
:clojure.tools.namespace.repl/load false should imply
:clojure.tools.namespace.repl/unload false. This makes CIDER honor that
convention.
@bbatsov bbatsov merged commit b88365d into clojure-emacs:master Feb 10, 2018
@bbatsov
Copy link
Member

bbatsov commented Feb 10, 2018

You've found an interesting problem with the inlined deps. I wonder if we suffer from something similar with other libraries, but I don't see an universal solution for this.

On a relate note - it might be even better if users could set this as some defcustom which can be dir-local. Anyways, thanks for looking into this and fixing the problem!

@cichli
Copy link
Member

cichli commented Dec 22, 2018

Good catch regarding the semantics of ::load. Thanks for the contribution @plexus!

On a relate note - it might be even better if users could set this as some defcustom which can be dir-local.

@bbatsov this was my original intention when including the dirs option to the refresh op, but I never got around to implementing the elisp side 😅.

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.

None yet

3 participants