startup.m file in the userpath folder, which is on the MATLAB search path.
It’s sort of understandable then that edit searched in the MATLAB search path, just as when it loads a file. But Julia doesn’t have a search path (for include and I feel edit should be consistent with that). I think having it is a misfeature in MATLAB.
[And while the startup.jl file is useful, for stuff to run before you hit the REPL, my view is it should be off by default for scripts. In case you’re thinking of that, I think it’s an anti-pattern to rely on something there, because then your script will not work the same for the next user.
I proposed changing the Julia default for scripts (also to not slow down benchmarking, you need to remember to add --startup-file=no), way back, but got shot down.]
My expectation is less about the specific startup.jl file, and more about general behavior. If any random myfile.jl exists in a directory where Julia knows to look, then I’d expect
edit("myfile.jl")
to open the file. If myfile.jl doesn’t exist, I’d expect some sort of error message, rather than silent failing.
Several packages might have the same file names (and several probably do). What you are asking for is better handled by your operating system (finding a file).
~I do not know what did I do with my previous attempt to post this so I am writing this so that discourse does not complain.~
Ah! Yes, I think it should tell you why it failed but it may have to do more with the editor than with the REPL.
I just tried in 1.8.5 and it started editing the file in the current working directory although it did not exist (this seems like the sensible behavior, as opposed to opening ~/.startup.jl). I think this is the behavior of my editor (emacs). So if your ENV["EDITOR"] refuses to do the operation it just exits and julia does not seem to care about the reason it exited.
Just for the curiosity, if you try to edit a nonexistent file with your ENV["EDITOR"] does it refuse?
This seems like something that belongs in either InteractiveUtils, or in editor tooling. I just tested in VS Code, and I couldn’t find any “Open startup.jl” in the menu.