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

compliment is unable to find completions for a namespace that is aliased as user #50

Closed
dpsutton opened this issue Feb 22, 2018 · 2 comments
Labels

Comments

@dpsutton
Copy link
Contributor

Had a bug report in #cider on clojure slack.

If you have a namespace that you require with an alias as user there will be no completions found. The bug is from


(defn resolve-namespace
  "Tries to resolve a namespace from the given symbol, either from a
  fully qualified name or an alias in the given namespace."
  [sym ns]
  (or (find-ns sym) ((ns-aliases ns) sym)))

as the prefix 'user comes in and this resolves to the single segment namespace user.

Note this happens on the special single-segment ns user but could happen on anything that is single segment ns and has the same name as an alias.

The fix seems easy in that the aliases should be consulted first and then single segment namespaces after. This works because if the person has imported something as user, this is what they would prefer. And would seem to make referring to the single segment namespace impossible so the completions should mimic.

@alexander-yakushev
Copy link
Owner

Makes perfect sense. Thanks for the fix!

@wusticality
Copy link

Thanks for the fix @dpsutton, that was driving me nuts! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants