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

Variables with colons aren't always completed #39

Closed
dpsutton opened this issue May 11, 2016 · 2 comments
Closed

Variables with colons aren't always completed #39

dpsutton opened this issue May 11, 2016 · 2 comments

Comments

@dpsutton
Copy link
Contributor

dpsutton commented May 11, 2016

I've written a failing test for you. This issue was raised on CIDER

But vars with semicolons colons in them can be completed when the text doesn't include them. for instance,

(fact "handles vars with semicolons in them"
    (def foo:bar 1)
    (def foo:baz 2)
    (src/candidates "foo" *ns* nil)
    => (contains #{"foo:bar" "foo:baz"} :gaps-ok) ;; passes

    (src/candidates "foo:" *ns* nil)
    => (contains #{"foo:bar" "foo:baz"} :gaps-ok) ;; fails

    (src/candidates "foo:b" *ns* nil)
    => (contains #{"foo:bar" "foo:baz"} :gaps-ok)) ;; fails
@dpsutton
Copy link
Contributor Author

oh and i put these in the t_ns_mappings.clj file. I wasn't sure of the etiquette of submitted a pull request with failing tests in it.

@alexander-yakushev
Copy link
Owner

First, : is a colon, ; is a semicolon ;)

Colons in symbols are disabled here: https://github.com/alexander-yakushev/compliment/blob/master/src/compliment/sources/ns_mappings.clj#L10 . It seemed a reasonable exclusion at that time, but now I see that colons are officially legal parts of symbols (http://clojure.org/reference/reader#_symbols).

I will fix this soon. Thanks for the provided test cases!

@dpsutton dpsutton changed the title Variables with semicolons aren't always completed Variables with colons aren't always completed May 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants