VS Code - Can't run Julia without debugging

For a few weeks now the command “Run Without Debugging” in VS Code runs Julia with debugging. This is true on three different machines. Is there something obvious I might be doing wrong?

I am running the latest version of VS Code and of the extension. I am not sure whether the behavior started after updating VS Code or the extension. I am running Windows 10.

Thanks in advance for any pointers here!

To run a Julia file open the VS Code command palette with ctrl+shift+P and search for Julia: Execute File. To add a keybinding to the command open the command palette (ctrl+shift+P) and search for Preferences: Open Keyboard Shortcuts, then search for Julia: Execute File and add the desired keybinding (for example ctrl+shift+Enter).

Thanks for your response. However, if I “Julia: Execute File”, then it seems to open the Julia REPL. Can I not just run Julia in the shell from VS Code, as I could before?

Let me try to be a bit more precise. I tried different versions of the Julia extension and execute “Run Without Debugging” on a script containing

using Primes
  • V.0.14.18: I get an error pop-up “configured debug type ‘julia’ is not supported”
  • V.0.15.40: everything look fine, script runs in 3 seconds
  • V.0.16.11 and V.0.17.2: I get message " Warning: Package VSCodeDebugger does not have Primes in its dependencies:", script runs in 5 seconds

If I use the shell inside VS Code however, the script executes more or less instantly.

So, in each case using “Run Without Debugging” seems to do something which increases startup time substantially. It looks like it does indeed do something debugging-related. What am I missing?

@davidanthoff Can you help with this?

If you’re just trying to execute the file, I don’t think you should use run without debugging, since that still executes the file through JuliaInterpreter.jl which can be really slow for non-trivial scripts. Just open a shell and do julia filename.jl.

That message you’re getting with 0.16 and 0.17 does seem like a bug though. Maybe file an issue?

OK, thanks @EHBaozi and all. That would explain the difference in execution time I have experienced. I’ll use the shell in the future, and I have a closer look at the ‘tasks’ in VS Code, I guess they allow me to make this more convenient.

I’ll try to file an issue re the potential bug some other time.

I have managed to set things up such I can just hit F5 to start Julia in the shell with the file I am working on. For future reference, maybe anyone finds this useful:

I’ve put this into tasks.json:

    "version": "2.0.0",
    "tasks": [
            "label": "Run Julia from Shell",
            "type": "process",
            "command": "julia",
            "args": ["${file}"],
            "problemMatcher": []

And added this to keybindings.json:

        "key": "f5",
        "command": "workbench.action.tasks.runTask",
        "args": "Run Julia from Shell"

I think there is a bug in VS Code itself that makes the run or debut mode sticky for the current session. So if you debugged first, all subsequent runs will actually be debugs, if you run first, all subsequent debugs will actually be runs. I think they merged a fix and it might have shipped in their latest release.

1 Like

Hi all! I am encountering a similar problem. I can run the file as expected but I can’t run and debug the file. I have deleted the .vscode directory, expecting debugger will work by default but it didn’t work.

I am not sure where the problem comes from, as vs code used to work quite well. I have been coding in python for the last few weeks but when I came back to Julia, this wired thing happened.

Do you guys have any idea about this?