Skip to content

cljr-slash triggers within keywords #305

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

Closed
achesnais opened this issue Mar 7, 2016 · 3 comments
Closed

cljr-slash triggers within keywords #305

achesnais opened this issue Mar 7, 2016 · 3 comments

Comments

@achesnais
Copy link

I write lots of Datomic queries which contain keywords with slashes in them (e.g. :artist/name), and I wish cljr-slash didn't trigger each time I wrote one as it interrupts for a noticeable instant my typing flow.

I see that cljr uses cider-in-comment-p and cider-in-string-p to decide on whether it must trigger. I wonder if one could add a check for keywords as well?

@expez
Copy link
Member

expez commented Mar 7, 2016

Thanks for the report, the current situation is clearly unacceptable!

@benedekfazekas
Copy link
Member

having second thoughts about this. a namespaced keyword needs a require so triggering cljr-slash is the right behaviour. only the : char is not stripped from the beginning of the prefix so it never finds the aliases it should.

@Malabarba
Copy link
Member

a namespaced keyword needs a require

Only if it uses a double-colon (::). If there's a single : then the prefix is not an alias.

benedekfazekas added a commit that referenced this issue Mar 21, 2016
Don't call lookup-alias for non namespaced keywords at all when slash is
typed. However trigger lookup alias with the leading :: stripped off the
prefix if the keyword is namespaced.

- rename `cljr--is-keyword?` -> `cljr--sans-ns-keyword?`
benedekfazekas added a commit that referenced this issue Mar 25, 2016
Don't call lookup-alias for non namespaced keywords at all when slash is
typed. However trigger lookup alias with the leading :: stripped off the
prefix if the keyword is namespaced.

- rename `cljr--is-keyword?` -> `cljr--sans-ns-keyword?`
benedekfazekas added a commit that referenced this issue Mar 25, 2016
Don't call lookup-alias for non namespaced keywords at all when slash is
typed. However trigger lookup alias with the leading :: stripped off the
prefix if the keyword is namespaced.

- fix bug in `cljr--keyword?` so it recognises aliased, `::` keywords
benedekfazekas added a commit that referenced this issue Mar 29, 2016
[Fix #305]  Handle keywords in `cljr-slash`

Don't call lookup-alias for non namespaced keywords at all when slash is
typed. However trigger lookup alias with the leading :: stripped off the
prefix if the keyword is namespaced.
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

4 participants