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

Support company-mode #490

Merged
merged 11 commits into from
Mar 2, 2014
Merged

Support company-mode #490

merged 11 commits into from
Mar 2, 2014

Conversation

dgutov
Copy link
Contributor

@dgutov dgutov commented Mar 2, 2014

Continued from clojure-emacs/ac-nrepl#30.

So far the only bug I'm aware of is in cider-company-location: if cider-jump-to-def fails with namespace error, the handler just prints the error message with message, and the former function returns the current buffer. Should nrepl-make-response-handler use error in these situations?

Also note that it works differently from what @steckerhalter did in company-cider: instead of showing the output of clojure.repl/source, it actually opens the file where a given function is defined.

(lambda (_buffer err) (message err))
nil))
(defun cider--jump-to-def-eval-fn-1 (response)
"Handle the synchronous response."
Copy link
Member

Choose a reason for hiding this comment

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

response -> RESPONSE

@bbatsov
Copy link
Member

bbatsov commented Mar 2, 2014

Overall the code looks good to me.

I guess using error in the handler makes sense. You should also update the CHANGELOG and rebase on top of the current master, so this can be cleanly merged.

@dgutov
Copy link
Contributor Author

dgutov commented Mar 2, 2014

Updated, rebased and pushed.

Making nrepl-make-response-handler raise an error was a bust, it swallows it and doesn't show the message at all. So that's a +1 hack in cider-company-location. If you don't like this one, an alternative would be to save the current buffer and point, and compare the new values with them before returning, only if they're not equal.

By the way, when the cider middleware is used, the same error makes it spew a stack trace in a hidden buffer in background and apparently not respond to the request at all (Emacs waits indefinitely).

@bbatsov
Copy link
Member

bbatsov commented Mar 2, 2014

@dgutov That will do for now. I'll take a look at the middleware issue. //cc @gtrak

bbatsov added a commit that referenced this pull request Mar 2, 2014
@bbatsov bbatsov merged commit be32b87 into clojure-emacs:master Mar 2, 2014
@bbatsov
Copy link
Member

bbatsov commented Mar 2, 2014

You might also report it here https://github.com/clojure-emacs/cider-nrepl, so we won't forget about it.

@dgutov dgutov deleted the company-capf branch March 3, 2014 00:35
@dgutov
Copy link
Contributor Author

dgutov commented Mar 3, 2014

Ah, I think it's clojure-emacs/cider-nrepl#7.

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.

2 participants