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

Add spec registry candidates #26

Open
arichiardi opened this issue Jun 3, 2018 · 11 comments
Open

Add spec registry candidates #26

arichiardi opened this issue Jun 3, 2018 · 11 comments

Comments

@arichiardi
Copy link
Contributor

Like in lumo for a start: https://github.com/anmonteiro/lumo/blob/master/src/cljs/snapshot/lumo/repl.cljs#L1240

If I remember correctly there was a problem with that implementation, still a good start.

@bbatsov
Copy link
Member

bbatsov commented Jun 3, 2018

Yeah, that'd be cool. @alexander-yakushev Is there some special support for specs in compliment?

@alexander-yakushev
Copy link
Member

Nothing yet, however, it is a good idea to add something for Spec. This will also require some long-due Compliment refactoring. I will think about it.

@arichiardi
Copy link
Contributor Author

Any new development on this one, I would be in favor of following @alexander-yakushev guidance on this, the code above works in lumo but the keyword match there is based on regex and sometimes faulty. cljs-tooling does a better job.

@alexander-yakushev
Copy link
Member

Sorry, could you give me some more context again? Are we discussing adding Spec support to Compliment, or to cljs-tooling? If it's the latter, I'm not much of an input here:).

If it's the former, I wonder which support exactly you are looking for. Compliment already completes keywords, that works for specs too, however doesn't say it's a spec. Is this what you meant?

@arichiardi
Copy link
Contributor Author

If it's the former, I wonder which support exactly you are looking for. Compliment already completes keywords, that works for specs too, however doesn't say it's a spec. Is this what you meant?

I guess that is the first step towards that, and if you do it I will follow the same approach so that it is uniform and implement it in cljs-tooling

@alexander-yakushev
Copy link
Member

Got you. So, what particularly do you have in mind beyond trivial keyword completion?

@arichiardi
Copy link
Contributor Author

didn't think this through too much but for starters if the keyword is a spec, we could fetch the definition and show it in eldoc.

@alexander-yakushev
Copy link
Member

That's not something Compliment can currently do (the eldoc part). It can only offer completion candidates, and also provide documentation for each candidate (but I don't think CIDER uses the documentation part anymore). I could perhaps add this possibility if it's easier for CIDER to get it from Compliment. @bbatsov ?

@arichiardi
Copy link
Contributor Author

Yep the eldoc would be another thing we would do from cider but we need to know from Compliment that a keyword is a spec and if Compliment has some info from the spec registry that could go in the company description/metadata

@arichiardi
Copy link
Contributor Author

Another very useful idea would be to get the whole spec tree given one - aka recurse the spec tree with something like:

(defn nested-specs
  [spec]
  (reduce-all-specs (s/form spec)))

@bbatsov
Copy link
Member

bbatsov commented Sep 17, 2018

That's not something Compliment can currently do (the eldoc part). It can only offer completion candidates, and also provide documentation for each candidate (but I don't think CIDER uses the documentation part anymore). I could perhaps add this possibility if it's easier for CIDER to get it from Compliment. @bbatsov ?

Yeah, CIDER doesn't use it. It used it a while ago, but then we've implemented a more flexible eldoc in cider-nrepl. Part of the reason for this what that we needed a consistent approach to handle eldoc in Clojure and ClojureScript.

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

No branches or pull requests

3 participants