-
Notifications
You must be signed in to change notification settings - Fork 112
Add supporting middleware op for magic requires? #215
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
Labels
Comments
Better not prompt while the user is in the middle of typing. Since magic-requires is already an existing feature, it's probably safe to make it smarter without bothering the user. |
|
expez
added a commit
that referenced
this issue
Aug 28, 2015
- Without middleware everything works as before. - `cljr-magic-require-namespaces` is now more of a seed value and if the middleware is active only plays a role in new projects. - On ambiguous aliases we prompt for resolution. Hopefully this will drive users to pick unique aliases which improves readability. - We keep a cache of aliases around, to keep things snappy. On larger projects the aliases are probably fairly stable. - The cache is updated,async, on repl init and everytime `clean-ns` is called. If the caching proves to be annoying we can change this easily to be a sync request for fresh data. If *that* proves too slow we can also easily cache the alias data in the middleware so we don't gather alias data from files that are unchanged since last scan.
expez
added a commit
that referenced
this issue
Aug 29, 2015
[Fix #215] Add middleware op for magic requires
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In most projects the use of aliases are consistent (and we should try to nudge people in that direction if they are not). How about making a middleware op to get the alias mappings in the current project and use those to serve up suggestions for magic require?
So if there's some ns on the disk called
com.acme.utils
which we've seen aliased asutil
then when the user typesutil/frobnicate
we can prompt if they'd likecom.acme.utils
added to the ns form.The text was updated successfully, but these errors were encountered: