-
Notifications
You must be signed in to change notification settings - Fork 347
Add hayoo backend for suggesting imports. #358
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
Add hayoo backend for suggesting imports. #358
Conversation
73821ab
to
4e9e538
Compare
4e9e538
to
fa7762c
Compare
;; TODO: gather packages as well, and when we choose a | ||
;; given import, check that we have the package in the | ||
;; cabal file as well. | ||
(modules-l (cl-mapcar (lambda (r) (cl-mapcar 'identity (assoc-default 'resultModules r))) results)) |
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.
Wouldn't the standard mapcar
be equivalent here?
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 can use cl-mapcan, but I also need to convert from vector to list (using append x nil).
However, I see another problem here. There is no queuing when asking the user for a response, so when multiple symbols are missing, they seem to be all over each other asking whether to add an import statement.
Some kind of explicit queuing seems to be needed when the prompt is called asyncronously.
(defun haskell-process-hayoo-ident (session file ident callback) | ||
"Hayoo for IDENT, returns a list of modules asyncronously through CALLBACK." | ||
;; This is a bit mysterious, but otherwise these are all unset | ||
(setq haskell-process-hayoo-ident--session session |
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.
lexical-let
might be an option here, right, since these vars are local to this function and its nested lambdas?
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.
Yes that seems to work. Thanks!
There's a build failure with the current version of this PR:
You can run |
Fixed. And thanks for the 'make check' tip. We now require 'cl during compilation until the code is converted to use On Thu, Oct 16, 2014 at 10:11 AM, Steve Purcell [email protected]
|
We only just removed Let me know if that makes sense, and I'll go ahead and squash then apply everything here. |
Looks good to me. |
Squashed and merged! Thanks for all your work on this. |
@purcell: close? |
NixOS doesn't seem to have a working hoogle, so hayoo is the better option. Added a hayoo backend.