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

Include special forms in apropos #410

Merged
merged 1 commit into from
Jun 16, 2017

Conversation

xiongtx
Copy link
Member

@xiongtx xiongtx commented Jun 16, 2017

Fixes #409.

Some special forms (e.g. if) are included in apropos if the search-ns is nil or
clojure.core.

Included special forms are those those with documentation in clojure.repl,
as well as &, catch, and finally, the first of which uses the
documentation of fn and the others that of try.

Update:

With Lein 2.7.1, this passes:

$ lein with-profile +master,+test-clj test

Ran 181 tests containing 1118 assertions.
0 failures, 0 errors.

Whereas this does not:

$ lein with-profile +master,+plugin.mranderson/config,+test-clj test

Exception in thread "main" java.io.FileNotFoundException: Could not locate fipp/edn__init.class or fipp/edn.clj on classpath., compiling:(cider/nrepl/middleware/pprint.clj:1:1)
	at clojure.lang.Compiler.load(Compiler.java:7391)
...

Maybe the thomasa/mranderson plugin needs to be updated?

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!

Fixes clojure-emacs#409.

Some special forms (e.g. `if`) are included in apropos if the `search-ns` is nil or
`clojure.core`.

Included special forms are those those with documentation in `clojure.repl`,
as well as `&`, `catch`, and `finally`, the first of which uses the
documentation of `fn` and the others that of `try`.
@bbatsov bbatsov merged commit bc269d5 into clojure-emacs:master Jun 16, 2017
xiongtx added a commit to clojure-emacs/helm-cider that referenced this pull request Jun 17, 2017
@xiongtx xiongtx deleted the 409-special-forms branch June 17, 2017 09:23
@xiongtx
Copy link
Member Author

xiongtx commented Jun 17, 2017

@bbatsov Seems like some of the tests are not passing, which I suspect is due to thomasa/mranderson. Who can look more into this?

@bbatsov
Copy link
Member

bbatsov commented Jun 17, 2017

Probably @benedekfazekas

@benedekfazekas
Copy link
Member

will have a look

xiongtx added a commit to xiongtx/cider-nrepl that referenced this pull request Jun 18, 2017
xiongtx added a commit to xiongtx/cider-nrepl that referenced this pull request Jun 18, 2017
(str/join "/" ((juxt (comp ns-name :ns) :name)
(meta v))))
(if (special-symbol? v)
(str (:name (info/resolve-special v)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So all these functions conflate symbols and vars now?

If that's the way, then I think instead of inserting (special-symbol? ...) checks everywhere it's better to have all these internals in one place - (var-meta ..). Also IMO including one middleware into another is not ideal. All these small utilities could easily live in a separate utility namespace (precisely what has been done as an aside of #405 btw).

@xiongtx do you plan for more imediate changes? Could you please give me a day or so to merge #405 as any changes to info and apropos will likely introduce hard conflicts with that branch. Thanks.

@xiongtx
Copy link
Member Author

xiongtx commented Jun 18, 2017

info.clj already conflates symbols and vars. How would you separate them?

@vspinu
Copy link
Contributor

vspinu commented Jun 18, 2017

Not sure. How and where is it conflating them?

I guess my point is that those small utility functions are useful outside of info.clj and better have precise semantics. So var-xyz better operate only on vars and not on anything else. But on the second though, (var-doc 'foo) could be defined as (:doc (:meta #'foo)) and not (:doc (:meta foo)). That would be quite consistent. Special symbols are not held in vars and cannot hold meta so there is probably no harm to treat them as pseudo vars.

@benedekfazekas
Copy link
Member

had a quick look on the build failures. They don't seem to be mranderson problems. The fact that only some java/clojure version variations fail in the matrix in itself is a good indication that it is not the inlining where something goes wrong.

hope this makes sense

xiongtx added a commit to xiongtx/cider-nrepl that referenced this pull request Jun 27, 2017
bbatsov pushed a commit that referenced this pull request Jun 27, 2017
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