Help, I'm going out of my mind - Julia and VS Code Problems

Hello all,

I’ve installed VS Code, Julia 1.1.1, and setup the system variable JULIA_HOME and path to point to the bin folder of Julia. julialang v0.12.0 is installed in VS Code.

But every time I try to run my code without debugging I get a select environment box, and the only options are c++ gdb, c++ windows, and node.js.

I’ve made sure in the workspace and user settings that it all points to the julia executable correctly but no cigar, VS Code refuses to run my julia code =(

Please help.

This is all on Windows 7 Pro x64

Thanks.

How are you trying to run your code? The julia extension does not hook into the debugging story of VS Code (yet).

Hi there, I was trying for a while to “start without debugging”, but then I learned of F5, but that’s a bit hit and miss and I had to make a tasks.json file and now use Terminal > run task, then select my json task. I did have it setup much slicker before but I can’t remember for the life of me how I did.

Also, I still get quite a few messages that the julia server has crashed and repl is not running, I have no idea why. Is it because I’m using a newer version of Julia than the vscode extension supports?

You definitely cannot use an unsupported Julia version. I’ve got 1.3-alpha installed and symlinked to julia and anytime I do anything with a Julia file in vscode I get absolutely buried with errors about the server crashing and whatnot.

I still get them sometimes when I have 1.1.1 as my “main” julia version but not nearly the same frequency (maybe a couple of times per day compared to every couple of seconds).

I’m currently using 1.1.1, I think I was using 1.1.0 before. Going to try v1.0.4 LTS now to see if that cuts out the server crashing errors.

EDIT:
OK, the server crash messages have stopped but F5 doesn’t work properly, where it used to be fine before I uninstalled VSCode. I am using a custom tasks.json file to execute shell commands to run my files (more through luck than judgement).

Any ideas how to get F5 to work correctly again?

For example F5 just returns 10 with this code when asked how many terms to compute, but when using shell commands in the tasks.json file it correctly runs the 10 terms and outputs their values:

using Printf
using Statistics

fSize = 0
i1 = 1
fTerm1 = 0
fTerm2 = 1

@printf("Please enter how many Fibonacci terms to calculate: ")
fSize = parse(Int64, readline())

@printf("Fibonacci Series upto term %d:\n",fSize)

for i1 in 1:fSize
    @printf("\n%d:> %d",i1,fTerm1)
    # println("$i1:> $fTerm1")
    if (fTerm1 % 2) == 0
        @printf(" * is an even number!")
        # println(" * is an even number!")
    end

    global nextTerm = fTerm1 + fTerm2
    global fTerm1 = fTerm2
    global fTerm2 = nextTerm
end

And my tasks.json file:

{
	// See https://go.microsoft.com/fwlink/?LinkId=733558
	// for the documentation about the tasks.json format
	"version": "2.0.0",
	"tasks": [
		{
			"label": "Julia: Run Current File",
			"type": "shell",
			"command": "%JULIA_HOME%\\julia.exe",
			"args": [
				"${file}"
			],
			"group": "test",
			"presentation": {
				// Reveal the output only if unrecognized errors occur.
				"reveal": "always",
				"panel": "new"
			},
			// Use the standard MS compiler pattern to detect errors, warnings and infos
			// "problemMatcher": "$msCompile"
		}
	]
}

@Monkspeed Stick with it. The Julia community here are really helpful.
I use Atom rather than VSCode, so sorry I have no direct hints or tips.

However can I say something cheeky - do not get bount up in the tools. I make that mistake often myself, as a systems guy.
Use the REPL or a Jupyter notebook.
Setting up Jupyter notebooks is a skoosh (*). Use the REPL and install IJulia

(*) Skoosh - Scottish word for easy