Julia in VSCode not working properly on WSL

I have been using Julia with wsl and vscode. I didn’t have much problems, though it was a little bit slow when running. After I had several issues with errors with the LS and others, I finally made it work, but it still is slow and more so, and now the terminal only shows the results, but no longer shows the commands it is running. Also, but that is a detail, once a line has an error, it remains marked as red even if I run it again and correct the error:

Well, in your scenario there are many layers of abstraction. Do thinks work if you:

  • install Julia 1.10 using juliaup (1.11. still has a few more issues than 1.10)
  • launch a bash terminal in VSCode
  • launch Julia from the bash terminal by typing julia or julia --project

?

I am working with juliaup, I added the lts and put it as the julia extension executable path, From the terminal in VScode I can run julia normally and use the REPL, but I would like to have normal functionallity when standing on a code line and ctrl+enter and have a response, or execute the whole file. Just normal stuff. Also, I am not able to make it show any plots:

n

Not even in the extension window does it show any result of the plot

Feel free to create a bug report: GitHub · Where software is built

The other question is, why are you using WSL in the first place? On Windows VSCode and Julia work together well, if you install Git for Windows first. It also provides a bash shell which can be used within VSCode to give you some Linux feeling.

1 Like

I do almost everythin relating to development in wsl, precisely because usually the problems arise trying to integrate windows with whichever programming language or environment. It should work well in linux, right?

Well, I guess Julia and VSCode are mainly tested on Windows, Linux and Mac and less often on WSL.

But the Julia VSCode plugin has a lot of issues, in the moment 962 open issues, so I prefer to use it only for basic tasks like syntax highlighting and goto-definition, not for advanced stuff like code execution, debugging or displaying figures. But everybody has different preferences.

How is your setup for code devlopment and execution? Writing the scripts and directly running them on the REPL? At the moment, my main pain is being able to plot. If I run a notebook, it shows the plots, but in a script, it does nothing.

Why are you not using a plotting package that opens a new window per plot? I find this very convenient because it allows to compare many plots on one screen. Many packages can do that, for example GitHub - aenarete/ControlPlots.jl: Easy to use plotting for control engineers and students

Sometimes you have to do that explicitely, like:

p=plot(rand(3))
display(p)

if it doesn’t work automatically.

1 Like