This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Can I somehow add custom completion source to cider-nrepl completion sources?
Sure, it's a matter of adding a defsource to https://github.com/alexander-yakushev/compliment ...cider-nrepl uses Compliment in an 'inlined' manner, via mranderson. If you get a basic POC for your intent we can help you bundling it if needed
Good read:
https://github.com/clojure-emacs/cider-nrepl/blob/95ce24bf1f40ef566aed2d073a41c943723cf1bd/src/cider/nrepl/middleware/complete.clj#L65
...we could modify this piece of middleware to accept a :sources
parameter that would extend the default set of sources. That way you wouldn't have to worry about mranderson at all.
Thanks. If I understood correctly, i can currently do it by making my own version of the middleware with altered clj-sources
or cljs-sources
.
With the change you mentioned I could possibly do it by just giving it a parameter in the future.
Yes. You can use make install
(exact instructions in readme) and you'll get that artifact installed into ~/.m2
I was able to get the complete
from cider-nrepl to give me my completitions with repl but not yet with it compiled to .m2
and using emacs. I suppose i need next to try send :op completion
to cider-nrepl and see if it returns the same thing.
I tried now with sending :op "complete"
to make repl
initiated nrepl. It returns nil
even in the case where i have stub completion that should return something in all cases.
:op "eval"
works fine.
My call:
(with-open [conn (nrepl/connect :port 51244)]
(-> (nrepl/client conn 1000) ; message receive timeout required
(nrepl/message {:op "complete" :prefix ":" :ns "ns" :context "(defn access-pattern [imaginary-subfield] (__prefix__ imaginary-subfield))"} )
nrepl/response-values))