I’m new to the VSCode editor and have some very basic newbie questions:
I just upgraded from Julia 1.5.3 to 1.6.0. Do I need to configure something in VSCode to made the editor “switch” to the newer installation? In the Getting Started guide it says:
“If you have installed Julia into a standard location on Mac or Windows, or if the Julia binary is on your PATH , the Julia VS Code extension should automatically find your Julia installation and you should not need to configure anything.”
So based on this, I would guess the answer is yes?
I think, it looks at the default location, so it may find another installation, not necessarily the latest version.
Just configure it to your needs, add the path to your v1.6.0.
So in rereading a thread that I started back in December (when I first downloaded VSCode), I was reminded of the very helpful versioninfo() command, which produced this:
julia> versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
So it looks like it’s running the latest version! This answers my question 3.
Regarding the path of my 1.6 install, I discovered that it is C:\Users\Michael\AppData\Local\Programs\Julia-1.6.0. I tried copying and pasting it into the text box for the Executable Path, but I got a pop-up messaging saying “Couldn’t start client Julia Language Server.” Weird…So for now, I’m going to leave the text box blank–VSCode seems to know when I download a new version and configures it automatically.
A couple lessons learned (mainly for my own reference, but in case it might help someone who stumbles across this post):
One way to find the default location of the your Julia installation is to find the installer in your Downloads folder and click Download again. It will display the file path ending in Julia-1.x.x. (Then click cancel, so as not to download Julia all over again.)
Julia may be installed in a hidden folder! I was very confused as to why I didn’t see the AppData in my folder named Michael. To make hidden folders visible: Open the File Explorer, click the View tab, locate the checkbox for “Hidden items” on the right hand side of the pane, and make sure it is checked!!
Because there is another folder inside bin that contains the actual executable. But yes, you should leave it blank and just add the latest version to your PATH environment variable.
How exactly do I add the latest version to the PATH environment variable?
Do I click “Edit in settings.json” in the box where it says “Julia: Environment Path”? When click on the edit link, the json file that opens contains a line that just says "julia.environmentPath": "" Do I just type C:\Users\Michael\AppData\Local\Programs\Julia-1.6.0 inside the last pair of quotes?
Adding something to PATH in Windows is just way more hassle than just put it into the VSCode config. But what is it all about? It’s running 1.6.0, so all is fine, isn’t it?
It is running 1.6.0 indeed. I thought it’d be good to learn how to manually specify the path inside of VSCode (just in case I need to use a different version of Julia for whatever reason…). But I may just leave things as they are for now, so as not to accidentally screw anything up
I have in settings.json: "julia.executablePath": "C:\\\\Users\\\\Oli\\\\AppData\\\\Local\\\\Programs\\\\Julia-1.6.0\\\\bin\\\\julia.exe"
4 times the backslash. I don’t know now if this is needed, but I let it for you to try it out
In the settings editor it shows now only one , in settings.json it shows with double \. So at some time I copy/pasted the path with double backslash into the editor (this is what we have screenshoted above) and it automatically every backslash was again backslashed when saved into settings.json. So it came to the 4 backslashes. Good to know, and surely something i forgot when 1.7 comes out.
I personally think putting it in PATH is a better option rather than fixing it in vscode. This is because I work in tandem with vscode, vscode internal terminal, and a REPL running on an external terminal. It would suck to have vscode launch 1.6 (since the path is explicility specified) and version 1.x run when typing in julia in the terminal.