-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Add REPL hook to prompt to install missing packages, if available in registry #2307
Add REPL hook to prompt to install missing packages, if available in registry #2307
Conversation
4a268bc
to
a3c9a07
Compare
ab34da5
to
5712114
Compare
bcd3d9a
to
13eada7
Compare
The base hook and handler support is now available given JuliaLang/julia#39026 has been merged. The formatting in this PR now looks like |
|
My thinking is that.. On the load side: Julia currently prints the load error message like On the registry side: Julia/Pkg can't guarantee that the package in the registry is the same package the user wants by name alone, so the I've been going back and forth on this though.. |
I don't really see how it hints to that. Perhaps the message can be tweaked somehow instead. |
How about
|
Yea that looks good. Perhaps printing the project path is not needed either? Or instead print
Perhaps "retry" instead of "load"? |
Perhaps it doesn't have to be included at all? I guess in general you either don't care about environments and it will mostly confuse you, or you know about environments, and then you know which one you run in . |
In the discussions that lead to the base PR a few people mentioned that showing the active project was important for not confusing the user, given they're not in Pkg mode, and hence don't have the env prefix visible on this action. If I was to vote I'd go for the original style with a 2nd line devoted to the project |
I see no discussion about this at all in JuliaLang/julia#39026. Honestly I don't quite understand why it would be important. The fact that you typed |
It's from your notes in JuliaLang/julia#26469 (comment) plus slack discussions.
True, but I see another use model for this.. people wanting to install packages without switching to I've added the single line project print back. Not to be forceful, but to present it alongside the other changes. Happy to revert if the consensus is something else |
3295e01
to
392c18c
Compare
I was just about to suggest the same: i.e. why not show it in a similar style as in the Pkg REPL mode. So +1 for this solution from me. |
It does feel minimal but informative. I've pushed the last one of those two |
@fredrikekre what do you think about that last example? Given this isn't being backported, perhaps the formatting could be trialled and adjusted based on use up to 1.7? |
The discussion is still open here but I’m thinking it’s better to merge sooner rather than too close to the 1.7 feature freeze, to see how it goes. I think I’ll merge but happily work with any formatting/info feedback. I’ll merge and update Pkg on master in an hour or so if no one has objection |
How about making it look kinda like the Pkg REPL mode syntax?
|
Yeah there's a really nice elegance to that, but I think the triage discussion was that the default action when the user hits return should be not to install. So it would have to be something like
|
Or perhaps just
|
Yea, I meant something like the latter. |
263c13e
to
33ae3a7
Compare
With offline help from @fredrikekre we arrived at this, which seems quite nice |
33ae3a7
to
a6dee3c
Compare
Paired with JuliaLang/julia#39026
Adds hooks into REPL to prompt to install packages if missing, and available in registry