Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Add spec completions #279

Merged
merged 2 commits into from
Sep 26, 2017
Merged

Conversation

arichiardi
Copy link
Collaborator

Here it is, spec completions are working fine.

I need some more time if we want to setup a couple of tests, but it looks like it is already working fine. One thing to think about is the position of the completion candidates. I put the before everything at the moment.

Any comment/feedback will be addressed 😄

@arichiardi
Copy link
Collaborator Author

Working on the tests for this one

(testing "arbitrary fully qualified keyword"
(s/def :arbitrary/a-spec string?)
(is-contains-completion ":arbitrary/" ":arbitrary/a-spec")
(reset! s/registry-ref {})))))
Copy link
Owner

Choose a reason for hiding this comment

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

does it work for aliased nses?

e.g. (s/def ::common/foo string?) and contains a completion for ::common/f

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Gonna add a test for that

(comp (mapcat keys) (map str))
((juxt :renames :rename-macros :uses :use-macros) (get-namespace cur-ns)))))
(concat (completion-candidates-for-spec cur-ns)
(into (completion-candidates-for-ns cur-ns true)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am not entirely sure we need this. It gets spec completions for the current namespace. What do you think?

Copy link
Owner

Choose a reason for hiding this comment

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

might be needed for ::a-spec-style completions?

@anmonteiro anmonteiro merged commit 633b422 into anmonteiro:master Sep 26, 2017
@arichiardi arichiardi deleted the spec-completions branch September 27, 2017 17:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants