-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
Suggest importing package when using an undefined function #2833
Comments
Nice! I think it's good to have a curated list of packages that can be auto-installed (instead of an auto search of all registered packages), just like in your case: :StaticArrays => [:SVector, Symbol("@SVector")],
:Statistics => [:mean, :median, :std, :cor, :cov, :quantile], How should we go about writing this list? How do we decide what goes in and what doesn't? In your case the feature gives a faster dev experience in the REPL "for the pros", but what I find most exciting is that it can help Julia beginners. I think it's common to copy-paste a code snippet (eg from ChatGPT) that contains a call to a popular function like |
I think this autoinstall feature has to involve a prompt anyway, it shouldn't be fully automatic. So, if I type
|
Maybe, "prompt" could be as simple as Pluto adding a cell above the executed one, with the content like using StatsBase
using # Plots, CairoMakie, WGLMakie, PyPlot, PythonPlot – uncomment one name here The cell should just be added automatically, but not executed. Then the user either just checks it and runs, or decides which of the "ambiguous" packages they want and then runs the cell. |
Pluto pioneered automatic package installation in Julia: just type
using PackageName
, and it's already there!Over the recent years, Julia REPL got features that make even more seamless exploratory experience possible. Julia itself provides auto-installation now (with a confirmation prompt), and autoloading can be added with a short
startup.jl
.Here's mine startup.jl, and below is a realtime recording of how it works. All installations are done into a temp env.
Would be nice if an undefined function/macro name is detected, Pluto looked up a list of common packages and symbols, and suggest to add
using ThisPackage
to the notebook!The text was updated successfully, but these errors were encountered: