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

I went to the Juno site and they’re abandoning it for VS code, which I think is a horror. Julia is supposed to be easy to use and replace multi-languages. VS code is hard to use and its feature is multi-languages. Why abandon Juno for it? I’ve tried to use VS three times and it errors out on one thing after another. I fix one problem and another pops up. It wants a commenting debugger when there is none available. It wants a special folder besides my program folder. It then errors out on other arcane things, one after another. I want to learn Julia, not $#@!# VS Code. Every other editor I’ve just picked up and ran programs as I went, just refining what I knew about them. You can’t “pick up” VS Code. And why does everyone want to be under the Microsoft umbrella? I remember having to code four different websites years ago - one for standards browsers, then three more for the Three Incompatible Msoft browsers. Msoft is overprogrammed and arrogant. Keep it simple.

1 Like

FWIW Juno is still perfectly operational, just not actively developed in terms of new features anymore. I still use it almost every day and prefer it over VSCode for the most part.

As to why development focus has shifted onto VSCode, Microsoft basically pulled the plug on Atom development with the acquisition of GitHub, so there’s little point in fosing on an editor (which is also multi-language btw) which isn’t being actively developed anymore.

6 Likes

And if you want the VSCode extension to be more intuitive/bug-free/nicer/whatever, then please consider giving more precise feedback than “it’s shit, I don’t wanna use it” (as also requested at Trouble installing VS Code for Julia - #6 by pfitzseb).

5 Likes

As you’re already aware of why M$ is a not-so-good company, the answer to this question is: ask why Microsoft told GitHub to abandon Atom editor in favor of their own VS Code when they purchased GitHub :slight_smile:

3 Likes

You can use any text editor with Julia, the VSCode extension is just the most well integrated.

VS code is hard to use and its feature is multi-languages.

Atom is also a multi-language text editor. Neither is a language specific IDE, although with extensions they can be IDE-lites.

Every other editor I’ve just picked up and ran programs as I went, just refining what I knew about them.

The same is true of VSCode. Type your script, save it. You can then run it with the Julia extension, or outside in another REPL.

Why abandon Juno for it?

One reason has already been mentioned, but another is that it’s where the users are. VSCode is immensely popular.

5 Likes

To highlight this, here is the Atom commit graph:

Here is the VS Code commit graph:

Note the scale of the y axes: VS Code is getting more than an order of magnitude more development effort than Atom is these days. Making and maintaining an IDE is expensive and Microsoft is spending money on VS Code rather than Atom. Unless someone has a plan to fund the maintenance and development of Atom independent of Microsoft, moving over to VS Code and trying to make the Julia part of that experience as smooth as possible is the only viable way forward.

17 Likes

Just a couple of additional observations:

  • VS Code (the core product) is having quite a focus on data sciency stuff for quite a while now. For example, Microsoft is going to ship a version in a few days that has native Jupyter Notebook support in the core product (i.e. they just finished moving that file format support from the Jupyter extension into VS Code itself). This is obviously great for us: we are building on a foundation that is trying to support some of the very same scenarios that are core to Julia.
  • Microsoft has been a fantastic partner for the core dev team of the Julia extension. They are open, they are transparent, they listen to our feedback and needs and interact with us, and are actually committed to helping us make the Julia extension work well on VS Code. For the recent notebook integration they even opened some of the crucial PRs and contributed code to the Julia extension and coordinated with us on rollout etc.
  • The entire design of language support in extensions in VS Code around language servers is actually such that as a side-effect of us providing the VS Code integration, a fair bit of the functionality is also available to entirely unrelated editors (vim, emacs etc.).

But of course @StefanKarpinski’s point is really the most important one here: one of these projects has an enormous momentum, the other one doesn’t.

16 Likes

It’s not classy to complain and whine at people, just because they decided to make a plugin for their preferred editor, and share it free of charge.

If you don’t like vs code, use another editor, there are plenty to choose from.

6 Likes

Please keep in mind that there are other options, including Emacs (multiple solutions), Vim, etc. See

3 Likes

Right, there’s zero requirement to learn VS Code to use Julia. There is excellent support for Julia in emacs, vim, SublimeText, Jupyter notebooks, etc. If someone wants to keep using Juno, they can also do that. The code still exists, it will continue to be downloadable. The “horror” here seems to be that other people will not be doing free work on the specific project that someone wants them to? :roll_eyes:

Not wanting to be under the “Microsoft umbrella” but wanting to use Juno, which is based on Atom, which is developed primarily by GitHub which is owned by Microsoft is also amusing. It’s Microsoft either way, man. It’s just a question of using the highly actively developed Microsoft project or the one that’s winding down.

12 Likes

On the topic of Juno it’s also worth noting that we’re still fixing critical bugs, so it’s not like there’s no support for it at all.

5 Likes

Oh, I’m not abandoning it. The developers did. Heck, I just added Javascript functionality to it. Great program. A new crew of developers needs to take over Juno and tell M$oft to go pound sand.

I see Notepad++ there. One of my favorites. Alas, I got “fail to import” when I tried to activate the extension. I posted the issue, though, so maybe they’ll fix it.

There is VSCodium, a clone without Microsoft branding, telemetry, etc.

3 Likes