On Windows 10, in my case, I need ENV["JULIA_EDITOR"] = "code.cmd -g"
.
Details:
julia> ENV["JULIA_EDITOR"] = "code "
julia> edit("test_4.jl", 7)
ERROR: IOError: could not spawn `code -g test_4.jl:7`: no such file or directory (ENOENT)
julia> ENV["JULIA_EDITOR"] = "code.cmd -g"
"code.cmd -g"
julia> edit("test_4.jl", 7)
julia> split(ENV["PATH"], ';')
12-element Vector{SubString{String}}:
...
"C:\\Users\\f\\AppData\\Local\\Programs\\Microsoft VS Code\\bin"
...
`